import React, { useState } from 'react'; import { useWorkerProfiles } from '@/lib/krowHooks'; import TalentPoolCard from '@/components/krow/TalentPoolCard'; import TalentDetailModal from '@/components/krow/TalentDetailModal'; import MessageCandidateModal from '@/components/krow/MessageCandidateModal'; import { Users } from 'lucide-react'; export default function TalentPool() { const { data: profiles = [], isLoading } = useWorkerProfiles(); const [search, setSearch] = useState(''); const [scoreFilter, setScoreFilter] = useState('all'); const [contactProfile, setContactProfile] = useState(null); const [viewProfile, setViewProfile] = useState(null); const filtered = profiles.filter((p) => { const q = search.toLowerCase(); const matchesSearch = !search || p.full_name?.toLowerCase().includes(q) || p.email?.toLowerCase().includes(q) || (p.skills || []).some((s) => s.toLowerCase().includes(q)) || p.desired_position?.toLowerCase().includes(q) || p.current_position?.toLowerCase().includes(q); const score = p.krow_score || 0; const matchesScore = scoreFilter === 'all' || (scoreFilter === 'elite' && score >= 90) || (scoreFilter === 'excellent' && score >= 75 && score < 90) || (scoreFilter === 'solid' && score >= 60 && score < 75) || (scoreFilter === 'building' && score > 0 && score < 60); return matchesSearch && matchesScore; }); const bandCounts = { elite: profiles.filter((p) => (p.krow_score || 0) >= 90).length, excellent: profiles.filter((p) => (p.krow_score || 0) >= 75 && (p.krow_score || 0) < 90).length, solid: profiles.filter((p) => (p.krow_score || 0) >= 60 && (p.krow_score || 0) < 75).length, building: profiles.filter((p) => (p.krow_score || 0) > 0 && (p.krow_score || 0) < 60).length, }; const contactApp = contactProfile ? { applicant_name: contactProfile.full_name, email: contactProfile.email, phone: contactProfile.phone } : null; return (
Browse all KROW talent and contact them directly
{bandCounts[b.key]}
No talent matches your filters