import Link from 'next/link'; import { redirect } from 'next/navigation'; import { ArrowRight, Plus } from 'lucide-react'; import { getApi } from '@/server/caller'; export const metadata = { title: 'Your jobs' }; export const dynamic = 'force-dynamic'; const STATUS_LABEL: Record = { open: 'Looking for pros', matched: 'Pros interested', booked: 'Booked', completed: 'Done', cancelled: 'Cancelled', }; export default async function JobsPage() { const api = await getApi(); let jobs: Awaited>; try { jobs = await api.job.mine(); } catch { redirect('/sign-in?next=/jobs'); } return (

Your jobs

Post a job
{jobs.length === 0 ? (

Nothing yet. Post a job and start swiping.

) : (
    {jobs.map((job) => (
  • {job.title} {STATUS_LABEL[job.status] ?? job.status} ยท {job.addressText}
  • ))}
)}
); }