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.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
Refactor: object destructure, cleanup
Khuram Niaz7f6824c9d165
diff --git a/src/components/AiSection.tsx b/src/components/AiSection.tsxindex e6eb381..d23396b 100644--- a/src/components/AiSection.tsx+++ b/src/components/AiSection.tsx@@ -106,17 +106,17 @@ const AiSection = ({ resume }: AiSectionProps) => {) : (<><div className="pt-2">- {aIContent.length > 3 ? (+ {aIContent.length > 3 && (<><h2 className="font-semibold">Summary:</h2><SheetDescription>{parse(aIContent).summary}</SheetDescription></>- ) : null}+ )}</div><div className="pt-2">- {aIContent.length > 3 && parse(aIContent).strengths ? (+ {aIContent.length > 3 && parse(aIContent).strengths && (<><h2 className="font-semibold">Strengths:</h2><SheetDescription>@@ -127,10 +127,10 @@ const AiSection = ({ resume }: AiSectionProps) => {)}</SheetDescription></>- ) : null}+ )}</div><div className="pt-2">- {aIContent.length > 3 && parse(aIContent).weaknesses ? (+ {aIContent.length > 3 && parse(aIContent).weaknesses && (<><h2 className="font-semibold">Weaknesses: </h2><SheetDescription>@@ -141,10 +141,10 @@ const AiSection = ({ resume }: AiSectionProps) => {)}</SheetDescription></>- ) : null}+ )}</div><div className="pt-2">- {aIContent.length > 3 && parse(aIContent).suggestions ? (+ {aIContent.length > 3 && parse(aIContent).suggestions && (<><h2 className="font-semibold">Suggestions: </h2><SheetDescription>@@ -155,11 +155,11 @@ const AiSection = ({ resume }: AiSectionProps) => {)}</SheetDescription></>- ) : null}+ )}<div className="pt-2">- {aIContent.length > 3 && parse(aIContent).score ? (+ {aIContent.length > 3 && parse(aIContent).score && (<h2>Review Score: {parse(aIContent).score}</h2>- ) : null}+ )}</div></div>{/* <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">diff --git a/src/components/DatePicker.tsx b/src/components/DatePicker.tsxindex 900521b..d1a10f0 100644--- a/src/components/DatePicker.tsx+++ b/src/components/DatePicker.tsx@@ -56,7 +56,7 @@ export function DatePicker({</FormControl></PopoverTrigger><PopoverContent className="flex w-auto flex-col space-y-2 p-2">- {presets ? (+ {presets && (<SelectonValueChange={(value) => {field.onChange(addDays(new Date(), parseInt(value)));@@ -73,7 +73,7 @@ export function DatePicker({<SelectItem value="7">In a week</SelectItem></SelectContent></Select>- ) : null}+ )}<div className="rounded-md border"><Calendarmode="single"diff --git a/src/components/admin/AddCompany.tsx b/src/components/admin/AddCompany.tsxindex 6c65ff7..9d99ee7 100644--- a/src/components/admin/AddCompany.tsx+++ b/src/components/admin/AddCompany.tsx@@ -170,9 +170,9 @@ function AddCompany({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (+ {isPending && (<Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ )}</Button></DialogFooter></div>diff --git a/src/components/admin/CompaniesTable.tsx b/src/components/admin/CompaniesTable.tsxindex a5aebec..ff388c0 100644--- a/src/components/admin/CompaniesTable.tsx+++ b/src/components/admin/CompaniesTable.tsx@@ -114,13 +114,13 @@ function CompaniesTable({of<strong> {totalCompanies}</strong> companies</div>- {totalCompanies > recordsPerPage ? (+ {totalCompanies > recordsPerPage && (<TablePaginationcurrentPage={currentPage}totalPages={totalPages}onPageChange={onPageChange}/>- ) : null}+ )}</>);}diff --git a/src/components/admin/JobLocationsTable.tsx b/src/components/admin/JobLocationsTable.tsxindex 490576d..3ec2cb6 100644--- a/src/components/admin/JobLocationsTable.tsx+++ b/src/components/admin/JobLocationsTable.tsx@@ -95,13 +95,13 @@ function JobLocationsTable({of<strong> {totalJobLocations}</strong> locations</div>- {totalJobLocations > recordsPerPage ? (+ {totalJobLocations > recordsPerPage && (<TablePaginationcurrentPage={currentPage}totalPages={totalPages}onPageChange={onPageChange}/>- ) : null}+ )}</>);}diff --git a/src/components/admin/JobTitlesTable.tsx b/src/components/admin/JobTitlesTable.tsxindex 4a17333..f64bd58 100644--- a/src/components/admin/JobTitlesTable.tsx+++ b/src/components/admin/JobTitlesTable.tsx@@ -92,13 +92,13 @@ function JobTitlesTable({of<strong> {totalJobTitles}</strong> titles</div>- {totalJobTitles > recordsPerPage ? (+ {totalJobTitles > recordsPerPage && (<TablePaginationcurrentPage={currentPage}totalPages={totalPages}onPageChange={onPageChange}/>- ) : null}+ )}</>);}diff --git a/src/components/myjobs/AddJob.tsx b/src/components/myjobs/AddJob.tsxindex 6abe84b..590ebff 100644--- a/src/components/myjobs/AddJob.tsx+++ b/src/components/myjobs/AddJob.tsx@@ -138,9 +138,8 @@ export function AddJob({const jobAppliedChange = (applied: boolean) => {if (applied) {- form.getValues("status") === jobStatuses[0].id- ? setValue("status", jobStatuses[1].id)- : null;+ form.getValues("status") === jobStatuses[0].id &&+ setValue("status", jobStatuses[1].id);setValue("dateApplied", new Date());} else {resetField("dateApplied");@@ -445,9 +444,9 @@ export function AddJob({</div><Button type="submit" data-testid="save-job-btn">Save- {isPending ? (+ {isPending && (<Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ )}</Button></DialogFooter></div>diff --git a/src/components/myjobs/JobDetails.tsx b/src/components/myjobs/JobDetails.tsxindex e94b57f..83bc0c2 100644--- a/src/components/myjobs/JobDetails.tsx+++ b/src/components/myjobs/JobDetails.tsx@@ -35,7 +35,7 @@ function JobDetails({ jobId }: { jobId: string }) {return (<>- {job?.id ? (+ {job?.id && (<div className="col-span-3"><DialogHeader className="mb-4"><DialogDescription>{job?.Company?.label}</DialogDescription>@@ -62,7 +62,7 @@ function JobDetails({ jobId }: { jobId: string }) {{format(new Date(job?.appliedDate), "PP")}</span></h3>- {job.jobUrl ? (+ {job.jobUrl && (<div className="my-3"><span className="font-semibold mr-2">Job URL:</span><a@@ -73,7 +73,7 @@ function JobDetails({ jobId }: { jobId: string }) {{job.jobUrl}</a></div>- ) : null}+ )}<div className="my-4"><TipTapContentViewer content={job?.description} /></div>@@ -85,7 +85,7 @@ function JobDetails({ jobId }: { jobId: string }) {</DialogClose></DialogFooter></div>- ) : null}+ )}</>);}diff --git a/src/components/myjobs/MyJobsTable.tsx b/src/components/myjobs/MyJobsTable.tsxindex 570aa40..ea670f7 100644--- a/src/components/myjobs/MyJobsTable.tsx+++ b/src/components/myjobs/MyJobsTable.tsx@@ -259,13 +259,13 @@ function MyJobsTable({of<strong> {totalJobs}</strong> jobs</div>- {totalJobs > jobsPerPage ? (+ {totalJobs > jobsPerPage && (<TablePaginationcurrentPage={currentPage}totalPages={totalPages}onPageChange={onPageChange}/>- ) : null}+ )}<AlertDialog open={alertOpen} onOpenChange={setAlertOpen}><AlertDialogContent><AlertDialogHeader>diff --git a/src/components/profile/AddContactInfo.tsx b/src/components/profile/AddContactInfo.tsxindex 1dec857..e38d1c0 100644--- a/src/components/profile/AddContactInfo.tsx+++ b/src/components/profile/AddContactInfo.tsx@@ -222,9 +222,7 @@ function AddContactInfo({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (- <Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ {isPending && <Loader className="h-4 w-4 shrink-0 spinner" />}</Button></DialogFooter></div>diff --git a/src/components/profile/AddEducation.tsx b/src/components/profile/AddEducation.tsxindex 3e41fde..b651037 100644--- a/src/components/profile/AddEducation.tsx+++ b/src/components/profile/AddEducation.tsx@@ -143,7 +143,7 @@ function AddEducation({className="grid grid-cols-1 md:grid-cols-2 gap-4 p-2">{/* SECTION TITLE */}- {!sectionId ? (+ {!sectionId && (<><div className="md:col-span-2"><FormField@@ -162,7 +162,7 @@ function AddEducation({</div><hr className="md:col-span-2" /></>- ) : null}+ )}{/* INSTITUTION */}<div>@@ -324,9 +324,7 @@ function AddEducation({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (- <Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ {isPending && <Loader className="h-4 w-4 shrink-0 spinner" />}</Button></DialogFooter></div>diff --git a/src/components/profile/AddExperience.tsx b/src/components/profile/AddExperience.tsxindex 19d76ff..3dd8090 100644--- a/src/components/profile/AddExperience.tsx+++ b/src/components/profile/AddExperience.tsx@@ -151,7 +151,7 @@ function AddExperience({className="grid grid-cols-1 md:grid-cols-2 gap-4 p-2">{/* SECTION TITLE */}- {!sectionId ? (+ {!sectionId && (<><div className="md:col-span-2"><FormField@@ -170,7 +170,7 @@ function AddExperience({</div><hr className="md:col-span-2" /></>- ) : null}+ )}{/* JOB TITLE */}<div>@@ -315,9 +315,7 @@ function AddExperience({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (- <Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ {isPending && <Loader className="h-4 w-4 shrink-0 spinner" />}</Button></DialogFooter></div>diff --git a/src/components/profile/AddResumeSummary.tsx b/src/components/profile/AddResumeSummary.tsxindex a2d2116..1913732 100644--- a/src/components/profile/AddResumeSummary.tsx+++ b/src/components/profile/AddResumeSummary.tsx@@ -150,9 +150,7 @@ function AddResumeSummary({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (- <Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ {isPending && <Loader className="h-4 w-4 shrink-0 spinner" />}</Button></DialogFooter></div>diff --git a/src/components/profile/ContactInfoCard.tsx b/src/components/profile/ContactInfoCard.tsxindex 69304db..156bcdf 100644--- a/src/components/profile/ContactInfoCard.tsx+++ b/src/components/profile/ContactInfoCard.tsx@@ -10,16 +10,17 @@ interface ContactInfoCardProps {}function ContactInfoCard({ contactInfo, openDialog }: ContactInfoCardProps) {+ const { firstName, lastName, headline, email, phone, address } = contactInfo!;return (<Card><CardHeader className="flex-row justify-between relative"><div><CardTitle>- {contactInfo?.firstName} {contactInfo?.lastName}+ {firstName} {lastName}</CardTitle>- <CardDescription>{contactInfo?.headline}</CardDescription>+ <CardDescription>{headline}</CardDescription><CardDescription>- {contactInfo?.email} - {contactInfo?.phone} - {contactInfo?.address}+ {email} - {phone} - {address}</CardDescription></div><Buttondiff --git a/src/components/profile/CreateResume.tsx b/src/components/profile/CreateResume.tsxindex 68a18d6..eecbac8 100644--- a/src/components/profile/CreateResume.tsx+++ b/src/components/profile/CreateResume.tsx@@ -140,9 +140,9 @@ function CreateResume({</DialogClose><Button type="submit" disabled={!formState.isDirty}>Save- {isPending ? (+ {isPending && (<Loader className="h-4 w-4 shrink-0 spinner" />- ) : null}+ )}</Button></DialogFooter></div>diff --git a/src/components/profile/EducationCard.tsx b/src/components/profile/EducationCard.tsxindex a031b20..3a7ece9 100644--- a/src/components/profile/EducationCard.tsx+++ b/src/components/profile/EducationCard.tsx@@ -21,49 +21,55 @@ function EducationCard({educationSection,openDialogForEdit,}: EducationCardProps) {+ const { sectionTitle, educations } = educationSection!;return (<>- <CardTitle className="pl-6 py-3">- {educationSection?.sectionTitle}- </CardTitle>- {educationSection?.educations?.map((education) => (- <Card key={education.id}>- <CardHeader className="p-2 pb-0 flex-row justify-between relative">- <CardTitle className="text-xl pl-4">- {education.institution}- </CardTitle>- <Button- variant="ghost"- size="sm"- className="h-8 gap-1 absolute top-0 right-1"- onClick={() => openDialogForEdit(education.id!)}- >- <Edit className="h-3.5 w-3.5" />- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">- Edit- </span>- </Button>- </CardHeader>- <CardContent>- <h3>- {education.degree}, {education.fieldOfStudy}- </h3>- <CardDescription>- {format(education.startDate, "MMM yyyy")} -{" "}- {education.endDate- ? format(education.endDate, "MMM yyyy")- : "Present"}- <br />- {education.location.label}- </CardDescription>- {education.description ? (- <div className="pt-2">- <TipTapContentViewer content={education.description} />- </div>- ) : null}- </CardContent>- </Card>- ))}+ <CardTitle className="pl-6 py-3">{sectionTitle}</CardTitle>+ {educations?.map(+ ({+ id,+ institution,+ degree,+ location: { label },+ fieldOfStudy,+ startDate,+ endDate,+ description,+ }) => (+ <Card key={id}>+ <CardHeader className="p-2 pb-0 flex-row justify-between relative">+ <CardTitle className="text-xl pl-4">{institution}</CardTitle>+ <Button+ variant="ghost"+ size="sm"+ className="h-8 gap-1 absolute top-0 right-1"+ onClick={() => openDialogForEdit(id!)}+ >+ <Edit className="h-3.5 w-3.5" />+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">+ Edit+ </span>+ </Button>+ </CardHeader>+ <CardContent>+ <h3>+ {degree}, {fieldOfStudy}+ </h3>+ <CardDescription>+ {format(startDate, "MMM yyyy")} -{" "}+ {endDate ? format(endDate, "MMM yyyy") : "Present"}+ <br />+ {label}+ </CardDescription>+ {description && (+ <div className="pt-2">+ <TipTapContentViewer content={description} />+ </div>+ )}+ </CardContent>+ </Card>+ )+ )}</>);}diff --git a/src/components/profile/ExperienceCard.tsx b/src/components/profile/ExperienceCard.tsxindex a6cfb86..6bb9230 100644--- a/src/components/profile/ExperienceCard.tsx+++ b/src/components/profile/ExperienceCard.tsx@@ -26,40 +26,46 @@ function ExperienceCard({<CardTitle className="pl-6 py-3">{experienceSection?.sectionTitle}</CardTitle>- {experienceSection?.workExperiences?.map((experience) => (- <Card key={experience.id}>- <CardHeader className="p-2 pb-0 flex-row justify-between relative">- <CardTitle className="text-xl pl-4">- {experience.jobTitle.label}- </CardTitle>- <Button- variant="ghost"- size="sm"- className="h-8 gap-1 absolute top-0 right-1"- onClick={() => openDialogForEdit(experience.id!)}- >- <Edit className="h-3.5 w-3.5" />- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">- Edit- </span>- </Button>- </CardHeader>- <CardContent>- <h3>{experience.Company.label}</h3>- <CardDescription>- {format(experience.startDate, "MMM yyyy")} -{" "}- {experience.endDate- ? format(experience.endDate, "MMM yyyy")- : "Present"}- <br />- {experience.location.label}- </CardDescription>- <div className="pt-2">- <TipTapContentViewer content={experience.description} />- </div>- </CardContent>- </Card>- ))}+ {experienceSection?.workExperiences?.map(+ ({+ id,+ jobTitle,+ Company,+ location,+ startDate,+ endDate,+ description,+ }) => (+ <Card key={id}>+ <CardHeader className="p-2 pb-0 flex-row justify-between relative">+ <CardTitle className="text-xl pl-4">{jobTitle.label}</CardTitle>+ <Button+ variant="ghost"+ size="sm"+ className="h-8 gap-1 absolute top-0 right-1"+ onClick={() => openDialogForEdit(id!)}+ >+ <Edit className="h-3.5 w-3.5" />+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">+ Edit+ </span>+ </Button>+ </CardHeader>+ <CardContent>+ <h3>{Company.label}</h3>+ <CardDescription>+ {format(startDate, "MMM yyyy")} -{" "}+ {endDate ? format(endDate, "MMM yyyy") : "Present"}+ <br />+ {location.label}+ </CardDescription>+ <div className="pt-2">+ <TipTapContentViewer content={description} />+ </div>+ </CardContent>+ </Card>+ )+ )}</>);}diff --git a/src/components/profile/ResumeContainer.tsx b/src/components/profile/ResumeContainer.tsxindex ca5b8eb..d4f57ca 100644--- a/src/components/profile/ResumeContainer.tsx+++ b/src/components/profile/ResumeContainer.tsx@@ -3,7 +3,7 @@ import { Resume, ResumeSection, SectionType } from "@/models/profile.model";import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";import AddResumeSection, { AddResumeSectionRef } from "./AddResumeSection";import ContactInfoCard from "./ContactInfoCard";-import { useRef, useState } from "react";+import { useRef } from "react";import SummarySectionCard from "./SummarySectionCard";import ExperienceCard from "./ExperienceCard";import EducationCard from "./EducationCard";@@ -11,17 +11,19 @@ import AiSection from "../AiSection";function ResumeContainer({ resume }: { resume: Resume }) {const resumeSectionRef = useRef<AddResumeSectionRef>(null);- const summarySection = resume?.ResumeSections?.find(+ const { title, ContactInfo, ResumeSections } = resume;++ const summarySection = ResumeSections?.find((section) => section.sectionType === SectionType.SUMMARY);- const experienceSection = resume?.ResumeSections?.find(+ const experienceSection = ResumeSections?.find((section) => section.sectionType === SectionType.EXPERIENCE);- const educationSection = resume?.ResumeSections?.find(+ const educationSection = ResumeSections?.find((section) => section.sectionType === SectionType.EDUCATION);const openContactInfoDialog = () => {- resumeSectionRef.current?.openContactInfoDialog(resume?.ContactInfo!);+ resumeSectionRef.current?.openContactInfoDialog(ContactInfo!);};const openSummaryDialogForEdit = () => {resumeSectionRef.current?.openSummaryDialog(summarySection!);@@ -50,37 +52,37 @@ function ResumeContainer({ resume }: { resume: Resume }) {<Card><CardHeader className="flex-row justify-between items-center"><CardTitle>Resume</CardTitle>- <CardDescription>{resume?.title}</CardDescription>+ <CardDescription>{title}</CardDescription><div className="flex items-center"><AddResumeSection resume={resume} ref={resumeSectionRef} /><AiSection resume={resume} /></div></CardHeader></Card>- {resume?.ContactInfo ? (+ {ContactInfo && (<ContactInfoCard- contactInfo={resume.ContactInfo}+ contactInfo={ContactInfo}openDialog={openContactInfoDialog}/>- ) : null}- {summarySection ? (+ )}+ {summarySection && (<SummarySectionCardsummarySection={summarySection}openDialogForEdit={openSummaryDialogForEdit}/>- ) : null}- {experienceSection ? (+ )}+ {experienceSection && (<ExperienceCardexperienceSection={experienceSection}openDialogForEdit={openExperienceDialogForEdit}/>- ) : null}- {educationSection ? (+ )}+ {educationSection && (<EducationCardeducationSection={educationSection}openDialogForEdit={openEducationDialogForEdit}/>- ) : null}+ )}</>);}diff --git a/src/components/profile/SummarySectionCard.tsx b/src/components/profile/SummarySectionCard.tsxindex 82eccba..824e1ce 100644--- a/src/components/profile/SummarySectionCard.tsx+++ b/src/components/profile/SummarySectionCard.tsx@@ -13,11 +13,12 @@ function SummarySectionCard({summarySection,openDialogForEdit,}: SummarySectionCardProps) {+ const { sectionTitle, summary } = summarySection!;return (<><Card><CardHeader className="flex-row justify-between relative">- <CardTitle>{summarySection?.sectionTitle}</CardTitle>+ <CardTitle>{sectionTitle}</CardTitle><Buttonvariant="ghost"size="sm"@@ -31,7 +32,7 @@ function SummarySectionCard({</Button></CardHeader><CardContent>- <TipTapContentViewer content={summarySection?.summary?.content!} />+ <TipTapContentViewer content={summary?.content!} /></CardContent></Card></>