import React from 'react'; import { cn } from '@/lib/utils'; const STAGES = [ { key: 'applied', label: 'Applied', color: 'bg-[#D1E0D7]', text: 'text-[#333F48]' }, { key: 'ai_screened', label: 'AI Screened', color: 'bg-[#F8E08E]', text: 'text-[#333F48]' }, { key: 'shortlisted', label: 'Shortlisted', color: 'bg-[#F9E547]', text: 'text-[#0838E0]' }, { key: 'interview', label: 'Interviewed', color: 'bg-[#333F48]', text: 'text-white' }, { key: 'hired', label: 'Hired', color: 'bg-[#0838E0]', text: 'text-white' }, ]; export default function PipelineFunnel({ applications }) { const counts = STAGES.map((s) => { if (s.key === 'ai_screened') { return applications.filter(a => ['ai_screened', 'shortlisted', 'interview', 'hired'].includes(a.status)).length; } if (s.key === 'shortlisted') { return applications.filter(a => ['shortlisted', 'interview', 'hired'].includes(a.status)).length; } if (s.key === 'interview') { return applications.filter(a => ['interview', 'hired'].includes(a.status)).length; } return applications.filter(a => a.status === s.key).length; }); const max = Math.max(...counts, 1); const total = counts[0] || 1; return (
Candidate progression through hiring funnel