Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

feat: enhance DiscoveredJobDetail component with CircularScore and improved layout

Khuram Niazd0a1460c5b87
diff --git a/src/components/automations/DiscoveredJobDetail.tsx b/src/components/automations/DiscoveredJobDetail.tsx
index ee72ddd..8fa6b6f 100644
--- a/src/components/automations/DiscoveredJobDetail.tsx
+++ b/src/components/automations/DiscoveredJobDetail.tsx
@@ -33,6 +33,7 @@ import {
import { MatchDetails } from "./MatchDetails";
import { PrerankBreakdown } from "./PrerankBreakdown";
import { TipTapContentViewer } from "@/components/TipTapContentViewer";
+import { CircularScore } from "@/components/CircularScore";
interface DiscoveredJobDetailProps {
job: DiscoveredJob | null;
@@ -127,57 +128,65 @@ export function DiscoveredJobDetail({
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl max-h-[90vh]">
<DialogHeader>
- <DialogTitle className="flex items-center gap-2">
- {job.JobTitle.label}
- {job.jobUrl && (
- <a
- href={job.jobUrl}
- target="_blank"
- rel="noopener noreferrer"
- className="text-muted-foreground hover:text-foreground"
+ <div className="flex items-start justify-between gap-4 pr-8">
+ <div className="min-w-0 space-y-1.5">
+ <DialogTitle className="flex items-center gap-2">
+ {job.JobTitle.label}
+ {job.jobUrl && (
+ <a
+ href={job.jobUrl}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="shrink-0 text-muted-foreground hover:text-foreground"
+ >
+ <ExternalLink className="h-4 w-4" />
+ </a>
+ )}
+ </DialogTitle>
+ <DialogDescription className="flex flex-wrap items-start gap-x-4 gap-y-1">
+ <span className="flex items-start gap-1">
+ <Building2 className="h-4 w-4 shrink-0 mt-0.5" />
+ {job.Company.label}
+ </span>
+ <span className="flex items-start gap-1">
+ <MapPin className="h-4 w-4 shrink-0 mt-0.5" />
+ {job.Location?.label || "N/A"}
+ </span>
+ {job.workplaceType && (
+ <Badge variant="outline">
+ {getWorkplaceTypeLabel(job.workplaceType, job.workplaceType)}
+ </Badge>
+ )}
+ </DialogDescription>
+ </div>
+ {analyzed ? (
+ job.matchScore != null && (
+ <div className="flex flex-col items-center gap-1 shrink-0">
+ <CircularScore score={job.matchScore} size="md" />
+ <span className="text-xs text-muted-foreground">AI Match</span>
+ </div>
+ )
+ ) : (
+ <Button
+ variant="outline"
+ onClick={handleAnalyze}
+ disabled={loadingAction !== null}
+ className="shrink-0"
>
- <ExternalLink className="h-4 w-4" />
- </a>
- )}
- </DialogTitle>
- <DialogDescription className="flex items-center gap-4">
- <span className="flex items-center gap-1">
- <Building2 className="h-4 w-4" />
- {job.Company.label}
- </span>
- <span className="flex items-center gap-1">
- <MapPin className="h-4 w-4" />
- {job.Location?.label || "N/A"}
- </span>
- {job.workplaceType && (
- <Badge variant="outline">
- {getWorkplaceTypeLabel(job.workplaceType, job.workplaceType)}
- </Badge>
+ {loadingAction === "analyze" ? (
+ <Loader2 className="h-4 w-4 mr-2 animate-spin" />
+ ) : (
+ <Sparkles className="h-4 w-4 mr-2" />
+ )}
+ Analyze match
+ </Button>
)}
- </DialogDescription>
+ </div>
</DialogHeader>
<ScrollArea className="max-h-[60vh]">
<div className="space-y-4 pr-4">
<div className="flex items-center gap-4">
- {analyzed ? (
- <Badge variant="default" className="text-lg px-3 py-1">
- {job.matchScore}% Match
- </Badge>
- ) : (
- <Button
- variant="outline"
- onClick={handleAnalyze}
- disabled={loadingAction !== null}
- >
- {loadingAction === "analyze" ? (
- <Loader2 className="h-4 w-4 mr-2 animate-spin" />
- ) : (
- <Sparkles className="h-4 w-4 mr-2" />
- )}
- Analyze match
- </Button>
- )}
<Badge variant="outline">{job.discoveryStatus}</Badge>
{job.automation && (
<span className="text-sm text-muted-foreground">