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.

refactor: extract shared ResponsiveCardHeader and SearchInput components

Khuram Niaz1899fc5bf01d
diff --git a/src/app/dashboard/automations/[id]/page.tsx b/src/app/dashboard/automations/[id]/page.tsx
index 3edfa04..7875743 100644
--- a/src/app/dashboard/automations/[id]/page.tsx
+++ b/src/app/dashboard/automations/[id]/page.tsx
@@ -563,23 +563,25 @@ export default function AutomationDetailPage() {
return (
<div className="col-span-3 py-6 space-y-6">
- <div className="flex items-center gap-4">
- <Button variant="ghost" size="icon" asChild>
- <Link href="/dashboard/automations">
- <ArrowLeft className="h-4 w-4" />
- </Link>
- </Button>
- <div className="flex-1">
- <h1 className="text-2xl font-bold">{automation.name}</h1>
- {(automation.keywords || automation.location) && (
- <p className="text-muted-foreground">
- {[automation.keywords, automation.location]
- .filter(Boolean)
- .join(" in ")}
- </p>
- )}
+ <div className="flex flex-col gap-4 sm:flex-row sm:items-center">
+ <div className="flex flex-1 min-w-0 items-center gap-4">
+ <Button variant="ghost" size="icon" asChild>
+ <Link href="/dashboard/automations">
+ <ArrowLeft className="h-4 w-4" />
+ </Link>
+ </Button>
+ <div className="flex-1 min-w-0">
+ <h1 className="text-2xl font-bold">{automation.name}</h1>
+ {(automation.keywords || automation.location) && (
+ <p className="text-muted-foreground">
+ {[automation.keywords, automation.location]
+ .filter(Boolean)
+ .join(" in ")}
+ </p>
+ )}
+ </div>
</div>
- <div className="flex gap-2">
+ <div className="flex flex-wrap gap-2">
<Button variant="outline" size="icon" onClick={() => loadData(true)}>
<RefreshCw className="h-4 w-4" />
</Button>
diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx
index b1884ee..5abcd0d 100644
--- a/src/app/dashboard/page.tsx
+++ b/src/app/dashboard/page.tsx
@@ -101,7 +101,7 @@ export default async function Dashboard() {
</div>
<div className="w-full col-span-3">
<Tabs defaultValue={activityCalendarDataKeys.at(-1)}>
- <TabsList>
+ <TabsList className="w-full justify-start overflow-x-auto">
{activityCalendarDataKeys.map((year) => (
<TabsTrigger key={year} value={year}>
{year}
diff --git a/src/components/ResponsiveCardHeader.tsx b/src/components/ResponsiveCardHeader.tsx
new file mode 100644
index 0000000..c886142
--- /dev/null
+++ b/src/components/ResponsiveCardHeader.tsx
@@ -0,0 +1,19 @@
+import { CardHeader } from "./ui/card";
+import { cn } from "@/lib/utils";
+
+function ResponsiveCardHeader({
+ className,
+ ...props
+}: React.ComponentProps<typeof CardHeader>) {
+ return (
+ <CardHeader
+ className={cn(
+ "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+export { ResponsiveCardHeader };
diff --git a/src/components/SearchInput.tsx b/src/components/SearchInput.tsx
new file mode 100644
index 0000000..644bd0e
--- /dev/null
+++ b/src/components/SearchInput.tsx
@@ -0,0 +1,25 @@
+"use client";
+
+import { Search } from "lucide-react";
+import { Input } from "./ui/input";
+
+interface SearchInputProps {
+ value: string;
+ onChange: (value: string) => void;
+ placeholder: string;
+}
+
+export function SearchInput({ value, onChange, placeholder }: SearchInputProps) {
+ return (
+ <div className="relative flex-1 min-w-[140px] sm:flex-none">
+ <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
+ <Input
+ type="search"
+ placeholder={placeholder}
+ className="pl-8 h-8 w-full sm:w-[150px] lg:w-[200px]"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ </div>
+ );
+}
diff --git a/src/components/activities/ActivitiesContainer.tsx b/src/components/activities/ActivitiesContainer.tsx
index 41c94b3..a3ca9ed 100644
--- a/src/components/activities/ActivitiesContainer.tsx
+++ b/src/components/activities/ActivitiesContainer.tsx
@@ -1,9 +1,10 @@
"use client";
import ActivitiesTable from "./ActivitiesTable";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { Button } from "../ui/button";
-import { Input } from "../ui/input";
-import { Loader, PlusCircle, Search } from "lucide-react";
+import { Loader, PlusCircle } from "lucide-react";
+import { SearchInput } from "../SearchInput";
import { useCallback, useEffect, useRef, useState } from "react";
import {
Dialog,
@@ -142,24 +143,19 @@ function ActivitiesContainer() {
return (
<Card>
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Activities</CardTitle>
{!initialLoading && totalActivities > 0 && (
<RecordsCount count={activitiesList.length} total={totalActivities} label="activities" />
)}
</div>
- <div className="flex items-center gap-2">
- <div className="relative">
- <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search activities..."
- className="pl-8 h-8 w-[150px] lg:w-[200px]"
- value={searchTerm}
- onChange={(e) => setSearchTerm(e.target.value)}
- />
- </div>
+ <div className="flex flex-wrap items-center gap-2">
+ <SearchInput
+ value={searchTerm}
+ onChange={setSearchTerm}
+ placeholder="Search activities..."
+ />
<Dialog open={activityFormOpen} onOpenChange={setActivityFormOpen}>
<DialogTrigger asChild>
<Button
@@ -187,7 +183,7 @@ function ActivitiesContainer() {
</DialogContent>
</Dialog>
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{initialLoading && <Loading />}
{activitiesList.length > 0 && (
diff --git a/src/components/admin/ActivityTypesContainer.tsx b/src/components/admin/ActivityTypesContainer.tsx
index 8688f46..1350157 100644
--- a/src/components/admin/ActivityTypesContainer.tsx
+++ b/src/components/admin/ActivityTypesContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { getActivityTypeList } from "@/actions/activity.actions";
import { APP_CONSTANTS } from "@/lib/constants";
import Loading from "../Loading";
@@ -43,19 +44,17 @@ function ActivityTypesContainer() {
<>
<div className="col-span-3">
<Card>
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Activity Types / Projects</CardTitle>
{!loading && totalActivityTypes > 0 && (
<RecordsCount count={activityTypes.length} total={totalActivityTypes} label="activity types" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- <AddActivityType reloadActivityTypes={reloadActivityTypes} />
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ <AddActivityType reloadActivityTypes={reloadActivityTypes} />
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{activityTypes.length > 0 && (
diff --git a/src/components/admin/AdminTabsContainer.tsx b/src/components/admin/AdminTabsContainer.tsx
index d575073..a14d290 100644
--- a/src/components/admin/AdminTabsContainer.tsx
+++ b/src/components/admin/AdminTabsContainer.tsx
@@ -32,7 +32,7 @@ function AdminTabsContainer() {
defaultValue={queryParams.get("tab") || "companies"}
onValueChange={(e) => onTabChange(e)}
>
- <TabsList>
+ <TabsList className="w-full justify-start overflow-x-auto">
<TabsTrigger value="companies">Companies</TabsTrigger>
<TabsTrigger value="job-titles">Job Titles</TabsTrigger>
<TabsTrigger value="locations">Locations</TabsTrigger>
diff --git a/src/components/admin/CompaniesContainer.tsx b/src/components/admin/CompaniesContainer.tsx
index 8942637..8d998b5 100644
--- a/src/components/admin/CompaniesContainer.tsx
+++ b/src/components/admin/CompaniesContainer.tsx
@@ -2,7 +2,8 @@
import { useCallback, useEffect, useState } from "react";
import AddCompany from "./AddCompany";
import CompaniesTable from "./CompaniesTable";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { Company } from "@/models/job.model";
import { getCompanyById, getCompanyList } from "@/actions/company.actions";
import { APP_CONSTANTS } from "@/lib/constants";
@@ -57,25 +58,23 @@ function CompaniesContainer() {
<>
<div className="col-span-3">
<Card x-chunk="dashboard-06-chunk-0">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Companies</CardTitle>
{!loading && totalCompanies > 0 && (
<RecordsCount count={companies.length} total={totalCompanies} label="companies" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- <AddCompany
- editCompany={editCompany}
- reloadCompanies={reloadCompanies}
- resetEditCompany={resetEditCompany}
- dialogOpen={dialogOpen}
- setDialogOpen={setDialogOpen}
- />
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ <AddCompany
+ editCompany={editCompany}
+ reloadCompanies={reloadCompanies}
+ resetEditCompany={resetEditCompany}
+ dialogOpen={dialogOpen}
+ setDialogOpen={setDialogOpen}
+ />
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{companies.length > 0 && (
diff --git a/src/components/admin/JobLocationsContainer.tsx b/src/components/admin/JobLocationsContainer.tsx
index 328c502..9f6fbf8 100644
--- a/src/components/admin/JobLocationsContainer.tsx
+++ b/src/components/admin/JobLocationsContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { APP_CONSTANTS } from "@/lib/constants";
import { JobTitle } from "@prisma/client";
import JobLocationsTable from "./JobLocationsTable";
@@ -44,19 +45,17 @@ function JobLocationsContainer() {
<>
<div className="col-span-3">
<Card x-chunk="dashboard-06-chunk-0">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Job Locations</CardTitle>
{!loading && totalJobLocations > 0 && (
<RecordsCount count={locations.length} total={totalJobLocations} label="job locations" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- {/* <AddCompany reloadCompanies={reloadJobLocations} /> */}
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ {/* <AddCompany reloadCompanies={reloadJobLocations} /> */}
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{locations.length > 0 && (
diff --git a/src/components/admin/JobSourcesContainer.tsx b/src/components/admin/JobSourcesContainer.tsx
index 7ab45d0..b1b7217 100644
--- a/src/components/admin/JobSourcesContainer.tsx
+++ b/src/components/admin/JobSourcesContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { APP_CONSTANTS } from "@/lib/constants";
import { JobSource } from "@/models/job.model";
import JobSourcesTable from "./JobSourcesTable";
@@ -44,18 +45,16 @@ function JobSourcesContainer() {
<>
<div className="col-span-3">
<Card x-chunk="dashboard-06-chunk-0">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Job Sources</CardTitle>
{!loading && totalJobSources > 0 && (
<RecordsCount count={sources.length} total={totalJobSources} label="job sources" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{sources.length > 0 && (
diff --git a/src/components/admin/JobTitlesContainer.tsx b/src/components/admin/JobTitlesContainer.tsx
index 9f82583..4d42f54 100644
--- a/src/components/admin/JobTitlesContainer.tsx
+++ b/src/components/admin/JobTitlesContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { APP_CONSTANTS } from "@/lib/constants";
import { JobTitle } from "@prisma/client";
import JobTitlesTable from "./JobTitlesTable";
@@ -44,19 +45,17 @@ function JobTitlesContainer() {
<>
<div className="col-span-3">
<Card x-chunk="dashboard-06-chunk-0">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Job Titles</CardTitle>
{!loading && totalJobTitles > 0 && (
<RecordsCount count={titles.length} total={totalJobTitles} label="job titles" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- {/* <AddCompany reloadCompanies={reloadJobTitles} /> */}
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ {/* <AddCompany reloadCompanies={reloadJobTitles} /> */}
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{titles.length > 0 && (
diff --git a/src/components/admin/TagsContainer.tsx b/src/components/admin/TagsContainer.tsx
index db897d1..f9ac932 100644
--- a/src/components/admin/TagsContainer.tsx
+++ b/src/components/admin/TagsContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { Tag } from "@/models/job.model";
import { getTagList } from "@/actions/tag.actions";
import { APP_CONSTANTS } from "@/lib/constants";
@@ -44,19 +45,17 @@ function TagsContainer() {
<>
<div className="col-span-3">
<Card>
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Skills/Tags</CardTitle>
{!loading && totalTags > 0 && (
<RecordsCount count={tags.length} total={totalTags} label="skills" />
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- <AddTag reloadTags={reloadTags} />
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ <AddTag reloadTags={reloadTags} />
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{tags.length > 0 && (
diff --git a/src/components/automations/AutomationContainer.tsx b/src/components/automations/AutomationContainer.tsx
index 01ac688..5497d7f 100644
--- a/src/components/automations/AutomationContainer.tsx
+++ b/src/components/automations/AutomationContainer.tsx
@@ -1,7 +1,8 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { Card, CardContent, CardTitle } from "@/components/ui/card";
+import { ResponsiveCardHeader } from "@/components/ResponsiveCardHeader";
import { Button } from "@/components/ui/button";
import { Plus, RefreshCw } from "lucide-react";
import { toast } from "@/components/ui/use-toast";
@@ -66,9 +67,9 @@ export function AutomationContainer({ resumes }: AutomationContainerProps) {
return (
<>
<Card>
- <CardHeader className="flex flex-row items-center justify-between">
+ <ResponsiveCardHeader>
<CardTitle>Automations</CardTitle>
- <div className="flex gap-2">
+ <div className="flex flex-wrap gap-2">
<Button variant="outline" size="icon" onClick={loadAutomations}>
<RefreshCw className="h-4 w-4" />
</Button>
@@ -77,7 +78,7 @@ export function AutomationContainer({ resumes }: AutomationContainerProps) {
Create Automation
</Button>
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading ? (
<Loading />
diff --git a/src/components/automations/DiscoveredJobsList.tsx b/src/components/automations/DiscoveredJobsList.tsx
index a537a97..140d967 100644
--- a/src/components/automations/DiscoveredJobsList.tsx
+++ b/src/components/automations/DiscoveredJobsList.tsx
@@ -296,7 +296,7 @@ export function DiscoveredJobsList({
return (
<Card>
<CardHeader>
- <div className="flex items-start justify-between gap-4">
+ <div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div className="space-y-1.5">
<CardTitle>Discovered Jobs</CardTitle>
{totalJobs > 0 && (
@@ -307,7 +307,7 @@ export function DiscoveredJobsList({
/>
)}
</div>
- <div className="flex items-center gap-2">
+ <div className="flex flex-wrap items-center gap-2">
{dismissedCount + newCount > 0 && (
<Button
variant="outline"
diff --git a/src/components/automations/LogsTab.tsx b/src/components/automations/LogsTab.tsx
index 9952301..2a86081 100644
--- a/src/components/automations/LogsTab.tsx
+++ b/src/components/automations/LogsTab.tsx
@@ -89,10 +89,10 @@ export function LogsTab({ logData, onClearLogs }: LogsTabProps) {
return (
<Card>
<CardHeader>
- <div className="flex items-center justify-between">
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<CardTitle>Automation Logs</CardTitle>
- <div className="flex items-center gap-2">
- <div className="flex gap-1">
+ <div className="flex flex-wrap items-center gap-2">
+ <div className="flex flex-wrap gap-1">
<Button
size="sm"
variant={filter === "all" ? "default" : "outline"}
diff --git a/src/components/myjobs/JobsContainer.tsx b/src/components/myjobs/JobsContainer.tsx
index 939f718..1e426d7 100644
--- a/src/components/myjobs/JobsContainer.tsx
+++ b/src/components/myjobs/JobsContainer.tsx
@@ -8,8 +8,8 @@ import {
CardTitle,
} from "../ui/card";
import { Button } from "../ui/button";
-import { Input } from "../ui/input";
-import { File, ListFilter, Loader, Search, X } from "lucide-react";
+import { SearchInput } from "../SearchInput";
+import { File, ListFilter, Loader, X } from "lucide-react";
import {
deleteJobById,
getJobDetails,
@@ -399,16 +399,11 @@ function JobsContainer({
<X className="h-3.5 w-3.5" />
</button>
)}
- <div className="relative flex-1 min-w-[140px] sm:flex-none">
- <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search jobs..."
- className="pl-8 h-8 w-full sm:w-[150px] lg:w-[200px]"
- value={searchTerm}
- onChange={(e) => setSearchTerm(e.target.value)}
- />
- </div>
+ <SearchInput
+ value={searchTerm}
+ onChange={setSearchTerm}
+ placeholder="Search jobs..."
+ />
<Select value={filterKey} onValueChange={onFilterChange}>
<SelectTrigger className="w-[120px] h-8">
<ListFilter className="h-3.5 w-3.5" />
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index f817fe1..cafc8da 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -250,7 +250,10 @@ export const AiJobMatchSection = ({
<SheetPortal>
<SheetContent
className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden"
- style={{ width: `${width}px`, maxWidth: "none" }}
+ style={{
+ width: `${width}px`,
+ maxWidth: `${APP_CONSTANTS.RESIZABLE_PANEL_MAX_WIDTH_RATIO * 100}vw`,
+ }}
>
{/* VS Code-style drag handle on left edge */}
<div
diff --git a/src/components/profile/AiResumeReviewSection.tsx b/src/components/profile/AiResumeReviewSection.tsx
index ada0a5c..4b91d00 100644
--- a/src/components/profile/AiResumeReviewSection.tsx
+++ b/src/components/profile/AiResumeReviewSection.tsx
@@ -14,6 +14,7 @@ import Loading from "../Loading";
import { useState, useEffect, useCallback, useRef } from "react";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
import { useResizablePanel } from "@/hooks/useResizablePanel";
+import { APP_CONSTANTS } from "@/lib/constants";
import { toast } from "../ui/use-toast";
import { Resume } from "@/models/profile.model";
import { AiModel, AiProvider, defaultModel } from "@/models/ai.model";
@@ -181,7 +182,10 @@ const AiResumeReviewSection = ({ resume }: AiSectionProps) => {
<SheetPortal>
<SheetContent
className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden"
- style={{ width: `${width}px`, maxWidth: "none" }}
+ style={{
+ width: `${width}px`,
+ maxWidth: `${APP_CONSTANTS.RESIZABLE_PANEL_MAX_WIDTH_RATIO * 100}vw`,
+ }}
>
{/* VS Code-style drag handle on left edge */}
<div
diff --git a/src/components/profile/ProfileContainer.tsx b/src/components/profile/ProfileContainer.tsx
index 6287d6f..79e89d4 100644
--- a/src/components/profile/ProfileContainer.tsx
+++ b/src/components/profile/ProfileContainer.tsx
@@ -2,7 +2,8 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import CreateResume from "./CreateResume";
import CreateCoverLetter from "./CreateCoverLetter";
-import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
+import { Card, CardContent, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import { getResumeList, getDefaultResumeId } from "@/actions/profile.actions";
import { getCoverLetterList } from "@/actions/coverLetter.actions";
import {
@@ -165,14 +166,14 @@ const ProfileContainer = () => {
return (
<Card>
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Profile</CardTitle>
{!loading && totalDocuments > 0 && (
<RecordsCount count={documents.length} total={totalDocuments} label="documents" />
)}
</div>
- <div className="flex items-center">
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="sm" variant="outline" className="h-8 gap-1">
@@ -212,7 +213,7 @@ const ProfileContainer = () => {
reloadDocuments={reloadDocuments}
/>
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{documents.length > 0 && (
diff --git a/src/components/profile/ResumeContainer.tsx b/src/components/profile/ResumeContainer.tsx
index b48f5d1..6d7b66e 100644
--- a/src/components/profile/ResumeContainer.tsx
+++ b/src/components/profile/ResumeContainer.tsx
@@ -1,6 +1,7 @@
"use client";
import { Resume, ResumeSection, SectionType } from "@/models/profile.model";
import { Card, CardDescription, CardHeader, CardTitle } from "../ui/card";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import AddResumeSection, { AddResumeSectionRef } from "./AddResumeSection";
import ContactInfoCard from "./ContactInfoCard";
import { useCallback, useEffect, useRef, useState, useTransition } from "react";
@@ -916,7 +917,7 @@ function ResumeContainer({
{/* STRUCTURE WITH AI BUTTON (empty imported resume, AI available) */}
{showStructureWithAI && (
<Card className="border-dashed">
- <CardHeader className="flex-row items-center justify-between">
+ <ResponsiveCardHeader>
<div>
<p className="text-sm text-muted-foreground">
A file is attached. Structure it into sections using AI.
@@ -945,7 +946,7 @@ function ResumeContainer({
)}
{isStructuring ? "Structuring…" : "Structure with AI"}
</Button>
- </CardHeader>
+ </ResponsiveCardHeader>
</Card>
)}
diff --git a/src/components/questions/QuestionsContainer.tsx b/src/components/questions/QuestionsContainer.tsx
index 1046bd3..3fc74ce 100644
--- a/src/components/questions/QuestionsContainer.tsx
+++ b/src/components/questions/QuestionsContainer.tsx
@@ -4,12 +4,12 @@ import {
Card,
CardContent,
CardFooter,
- CardHeader,
CardTitle,
} from "../ui/card";
import { Button } from "../ui/button";
-import { PlusCircle, Search } from "lucide-react";
-import { Input } from "../ui/input";
+import { PlusCircle } from "lucide-react";
+import { SearchInput } from "../SearchInput";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import {
deleteQuestion,
getQuestionById,
@@ -134,7 +134,7 @@ function QuestionsContainer({
return (
<>
<Card className="h-full">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Questions</CardTitle>
{!loading && totalQuestions > 0 && (
@@ -145,32 +145,25 @@ function QuestionsContainer({
/>
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- <div className="relative">
- <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search questions..."
- className="pl-8 h-8 w-[150px] lg:w-[200px]"
- value={searchTerm}
- onChange={(e) => setSearchTerm(e.target.value)}
- />
- </div>
- <Button
- size="sm"
- variant="outline"
- className="h-8 gap-1"
- onClick={addQuestionForm}
- >
- <PlusCircle className="h-3.5 w-3.5" />
- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
- New Question
- </span>
- </Button>
- </div>
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ <SearchInput
+ value={searchTerm}
+ onChange={setSearchTerm}
+ placeholder="Search questions..."
+ />
+ <Button
+ size="sm"
+ variant="outline"
+ className="h-8 gap-1"
+ onClick={addQuestionForm}
+ >
+ <PlusCircle className="h-3.5 w-3.5" />
+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
+ New Question
+ </span>
+ </Button>
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{loading && <Loading />}
{!loading && (
diff --git a/src/components/tasks/TasksContainer.tsx b/src/components/tasks/TasksContainer.tsx
index e94c385..7b30047 100644
--- a/src/components/tasks/TasksContainer.tsx
+++ b/src/components/tasks/TasksContainer.tsx
@@ -5,12 +5,12 @@ import {
Card,
CardContent,
CardFooter,
- CardHeader,
CardTitle,
} from "../ui/card";
import { Button } from "../ui/button";
-import { ListFilter, Loader, PlusCircle, Filter, Search } from "lucide-react";
-import { Input } from "../ui/input";
+import { ListFilter, Loader, PlusCircle, Filter } from "lucide-react";
+import { SearchInput } from "../SearchInput";
+import { ResponsiveCardHeader } from "../ResponsiveCardHeader";
import {
deleteTaskById,
getTaskById,
@@ -282,7 +282,7 @@ function TasksContainer({
return (
<>
<Card x-chunk="dashboard-tasks-chunk-0" className="h-full">
- <CardHeader className="flex-row justify-between items-center">
+ <ResponsiveCardHeader>
<div className="flex items-baseline gap-2">
<CardTitle>Tasks</CardTitle>
{!initialLoading && totalTasks > 0 && (
@@ -293,97 +293,90 @@ function TasksContainer({
/>
)}
</div>
- <div className="flex items-center">
- <div className="ml-auto flex items-center gap-2">
- <div className="relative">
- <Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search tasks..."
- className="pl-8 h-8 w-[150px] lg:w-[200px]"
- value={searchTerm}
- onChange={(e) => setSearchTerm(e.target.value)}
- />
- </div>
- {mounted ? (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="outline" size="sm" className="h-8 gap-1">
- <Filter className="h-3.5 w-3.5" />
- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
- Status
- </span>
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <DropdownMenuLabel>Filter by Status</DropdownMenuLabel>
- <DropdownMenuSeparator />
- {(Object.keys(TASK_STATUSES) as TaskStatus[]).map(
- (status) => (
- <DropdownMenuCheckboxItem
- key={status}
- checked={statusFilter.includes(status)}
- onCheckedChange={() => toggleStatusFilter(status)}
- >
- {TASK_STATUSES[status]}
- </DropdownMenuCheckboxItem>
- ),
- )}
- </DropdownMenuContent>
- </DropdownMenu>
- ) : (
- <Button variant="outline" size="sm" className="h-8 gap-1">
- <Filter className="h-3.5 w-3.5" />
- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
- Status
- </span>
- </Button>
- )}
- {mounted ? (
- <Select value={groupBy} onValueChange={onGroupByChange}>
- <SelectTrigger className="w-[140px] h-8">
- <ListFilter className="h-3.5 w-3.5" />
- <SelectValue placeholder="Group by" />
- </SelectTrigger>
- <SelectContent>
- <SelectGroup>
- <SelectLabel>Group by</SelectLabel>
- <SelectSeparator />
- <SelectItem value="none">None</SelectItem>
- <SelectItem value="createdDate">Created Date</SelectItem>
- <SelectItem value="dueDate">Due Date</SelectItem>
- <SelectItem value="updatedDate">Updated Date</SelectItem>
- <SelectItem value="activityType">
- Activity Type
- </SelectItem>
- </SelectGroup>
- </SelectContent>
- </Select>
- ) : (
- <Button
- variant="outline"
- size="sm"
- className="h-8 gap-1 w-[140px]"
- >
+ <div className="flex flex-wrap items-center gap-2 sm:ml-auto">
+ <SearchInput
+ value={searchTerm}
+ onChange={setSearchTerm}
+ placeholder="Search tasks..."
+ />
+ {mounted ? (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline" size="sm" className="h-8 gap-1">
+ <Filter className="h-3.5 w-3.5" />
+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
+ Status
+ </span>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuLabel>Filter by Status</DropdownMenuLabel>
+ <DropdownMenuSeparator />
+ {(Object.keys(TASK_STATUSES) as TaskStatus[]).map(
+ (status) => (
+ <DropdownMenuCheckboxItem
+ key={status}
+ checked={statusFilter.includes(status)}
+ onCheckedChange={() => toggleStatusFilter(status)}
+ >
+ {TASK_STATUSES[status]}
+ </DropdownMenuCheckboxItem>
+ ),
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ ) : (
+ <Button variant="outline" size="sm" className="h-8 gap-1">
+ <Filter className="h-3.5 w-3.5" />
+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
+ Status
+ </span>
+ </Button>
+ )}
+ {mounted ? (
+ <Select value={groupBy} onValueChange={onGroupByChange}>
+ <SelectTrigger className="w-[140px] h-8">
<ListFilter className="h-3.5 w-3.5" />
- <span>Group by</span>
- </Button>
- )}
+ <SelectValue placeholder="Group by" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectGroup>
+ <SelectLabel>Group by</SelectLabel>
+ <SelectSeparator />
+ <SelectItem value="none">None</SelectItem>
+ <SelectItem value="createdDate">Created Date</SelectItem>
+ <SelectItem value="dueDate">Due Date</SelectItem>
+ <SelectItem value="updatedDate">Updated Date</SelectItem>
+ <SelectItem value="activityType">
+ Activity Type
+ </SelectItem>
+ </SelectGroup>
+ </SelectContent>
+ </Select>
+ ) : (
<Button
- size="sm"
variant="outline"
- className="h-8 gap-1"
- onClick={addTaskForm}
- data-testid="add-task-btn"
+ size="sm"
+ className="h-8 gap-1 w-[140px]"
>
- <PlusCircle className="h-3.5 w-3.5" />
- <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
- New Task
- </span>
+ <ListFilter className="h-3.5 w-3.5" />
+ <span>Group by</span>
</Button>
- </div>
+ )}
+ <Button
+ size="sm"
+ variant="outline"
+ className="h-8 gap-1"
+ onClick={addTaskForm}
+ data-testid="add-task-btn"
+ >
+ <PlusCircle className="h-3.5 w-3.5" />
+ <span className="sr-only sm:not-sr-only sm:whitespace-nowrap">
+ New Task
+ </span>
+ </Button>
</div>
- </CardHeader>
+ </ResponsiveCardHeader>
<CardContent>
{initialLoading && <Loading />}
{!initialLoading && tasks.length > 0 && (
diff --git a/src/components/tasks/TasksTable.tsx b/src/components/tasks/TasksTable.tsx
index 887c1f0..153b7e7 100644
--- a/src/components/tasks/TasksTable.tsx
+++ b/src/components/tasks/TasksTable.tsx
@@ -338,7 +338,7 @@ function TasksTable({
</DropdownMenuContent>
</DropdownMenu>
</TableCell>
- <TableCell className="py-1 px-1">
+ <TableCell className="hidden sm:table-cell py-1 px-1">
{!task.activity && (
<Button
title="Start Activity"
@@ -376,7 +376,7 @@ function TasksTable({
<TableHead className="h-9 px-1">
<span className="sr-only">Actions</span>
</TableHead>
- <TableHead className="h-9 px-1">
+ <TableHead className="hidden sm:table-cell h-9 px-1">
<span className="sr-only">Start Activity</span>
</TableHead>
</TableRow>
diff --git a/src/hooks/useResizablePanel.ts b/src/hooks/useResizablePanel.ts
index f275202..322ee0c 100644
--- a/src/hooks/useResizablePanel.ts
+++ b/src/hooks/useResizablePanel.ts
@@ -1,9 +1,12 @@
import { useState, useEffect, useRef, useCallback } from "react";
import { getFromLocalStorage, saveToLocalStorage } from "@/utils/localstorage.utils";
+import { APP_CONSTANTS } from "@/lib/constants";
-const DEFAULT_WIDTH = 450;
-const MIN_WIDTH = 320;
-const MAX_WIDTH_RATIO = 0.9;
+const {
+ RESIZABLE_PANEL_DEFAULT_WIDTH: DEFAULT_WIDTH,
+ RESIZABLE_PANEL_MIN_WIDTH: MIN_WIDTH,
+ RESIZABLE_PANEL_MAX_WIDTH_RATIO: MAX_WIDTH_RATIO,
+} = APP_CONSTANTS;
export function useResizablePanel(storageKey: string) {
const [width, setWidth] = useState<number>(() =>
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 80d35f5..8c9327d 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -100,6 +100,11 @@ export const APP_CONSTANTS = {
RESUME_IMPORT_MAX_DOCX_ENTRIES: 1_000,
RESUME_IMPORT_MAX_DOCX_UNCOMPRESSED_BYTES: 100 * 1024 * 1024, // 100 MB
RESUME_IMPORT_EXTRACT_TIMEOUT_MS: 30_000, // 30 seconds
+
+ // Resizable panel (AI job match / resume review sheets)
+ RESIZABLE_PANEL_DEFAULT_WIDTH: 450,
+ RESIZABLE_PANEL_MIN_WIDTH: 320,
+ RESIZABLE_PANEL_MAX_WIDTH_RATIO: 0.9,
} as const;
export const SCHEDULER_CONSTANTS = {