/opt/canhelp/apps/web/src/components
NameSizeModeActions
AdminRolePreview.tsx49280644editdlrm
BecomeSpecialistButton.tsx7020644editdlrm
CategoryIcon.tsx15760644editdlrm
FaqAccordion.tsx15000644editdlrm
FavoriteSpecialistButton.tsx14640644editdlrm
Footer.tsx30190644editdlrm
Header.tsx304790644editdlrm
HeroFloatingIcons.tsx43780644editdlrm
HeroSearch.tsx16110644editdlrm
HomeCategoryGrid.tsx46250644editdlrm
HomeCityCloud.tsx17900644editdlrm
HomeCityPicker.tsx54900644editdlrm
HomeSectionArt.tsx59120644editdlrm
LanguageSwitcher.tsx24380644editdlrm
PlanBadge.tsx31000644editdlrm
PromoCountdown.tsx34830644editdlrm
ScrollToTopButton.tsx8180644editdlrm
Section.tsx2520644editdlrm
ShareButton.tsx10410644editdlrm
SocialIcons.tsx68710644editdlrm
SpecialistsFiltersClient.tsx64610644editdlrm
SpecialistTaskCard.tsx28370644editdlrm
SupportModal.tsx61950644editdlrm
TaskCategoryPicker.tsx111170644editdlrm
TaskLocationPicker.tsx110380644editdlrm
Turnstile.tsx6510644editdlrm
UpgradePrompt.tsx34270644editdlrm
UsageMeter.tsx16020644editdlrm
Edit: /opt/canhelp/apps/web/src/components/SupportModal.tsx (6195B)
'use client' import { useState } from 'react' import { useLocale } from '@/context/locale' import { createSupportTicket } from '@/lib/api' type TicketType = 'bug' | 'suggestion' | 'other' interface Props { onClose: () => void } export default function SupportModal({ onClose }: Props) { const { t } = useLocale() const [type, setType] = useState('bug') const [subject, setSubject] = useState('') const [body, setBody] = useState('') const [loading, setLoading] = useState(false) const [sent, setSent] = useState(false) const [error, setError] = useState('') const TYPES: { value: TicketType; label: string; icon: string; color: string }[] = [ { value: 'bug', label: t('support.type.bug'), icon: '🐛', color: 'border-red-300 bg-red-50 text-red-700' }, { value: 'suggestion', label: t('support.type.suggestion'), icon: '💡', color: 'border-green-300 bg-green-50 text-green-700' }, { value: 'other', label: t('support.type.other'), icon: '💬', color: 'border-gray-300 bg-gray-50 text-gray-700' }, ] async function handleSubmit(e: React.FormEvent) { e.preventDefault() setError('') setLoading(true) try { await createSupportTicket({ type, subject, body }) setSent(true) } catch { setError(t('support.error')) } finally { setLoading(false) } } return (
e.target === e.currentTarget && onClose()} >
{/* Header */}

{t('support.title')}

{sent ? ( /* Success state */

{t('support.sent.title')}

{t('support.sent.body')}

) : (
{/* Type selector */}

{t('support.type.label')}

{TYPES.map(({ value, label, icon, color }) => ( ))}
{/* Subject */}
setSubject(e.target.value)} required minLength={3} maxLength={200} placeholder={t('support.subject.placeholder')} className="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" />
{/* Body */}