import type { JobApplication } from '@/types/entities'; import React, { useState } from 'react'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Mail, Phone, Send, CheckCircle2 } from 'lucide-react'; import { useTranslation } from 'react-i18next'; interface MessageCandidateModalProps { open: boolean; onClose?: () => void; /* `Partial`: `TalentPool` opens this with a target built from a profile — name, email and phone — rather than a stored application. */ application: Partial; } export default function MessageCandidateModal({ open, onClose, application }: MessageCandidateModalProps) { const { t } = useTranslation(); const [channel, setChannel] = useState('message'); const [message, setMessage] = useState(''); const [sent, setSent] = useState(false); const handleSend = () => { setSent(true); setTimeout(() => { setSent(false); setMessage(''); onClose(); }, 1500); }; return ( !v && onClose()}> {t('messageCandidateModal.message')} {application?.applicant_name} {sent ? (

{t('messageCandidateModal.messageSent')}

) : (
{channel === 'call' ? (
{t('messageCandidateModal.calling')} {application?.phone || 'candidate'}...
) : (