diff --git a/src/components/contacts/ContactForm.tsx b/src/components/contacts/ContactForm.tsx index 915b91fa..0d0e2191 100644 --- a/src/components/contacts/ContactForm.tsx +++ b/src/components/contacts/ContactForm.tsx @@ -27,6 +27,7 @@ import { ShieldX, Building2, Briefcase, + Users, } from 'lucide-react'; import { Contact, ContactFormData } from '@/types/contacts'; import ContactLabels from './ContactLabels'; @@ -50,7 +51,7 @@ interface ContactFormProps { } interface FormData { - type: 'person' | 'company'; + type: 'person' | 'company' | 'group'; firstName: string; lastName: string; email: string; @@ -291,8 +292,8 @@ export default function ContactForm({ // Tax ID validation based on country if (formData.tax_id) { - if (!validateTaxId(formData.tax_id, phoneCountry, formData.type)) { - const taxIdLabel = getTaxIdLabel(phoneCountry, formData.type); + if (!validateTaxId(formData.tax_id, phoneCountry, taxIdType)) { + const taxIdLabel = getTaxIdLabel(phoneCountry, taxIdType); newErrors.tax_id = t('form.validation.taxIdInvalid', { type: taxIdLabel }); } } @@ -349,6 +350,7 @@ export default function ContactForm({ const isCompany = formData.type === 'company'; const isPerson = formData.type === 'person'; + const taxIdType: 'person' | 'company' = formData.type === 'company' ? 'company' : 'person'; // Detect country from phone number const handlePhoneChange = (value: string) => { @@ -368,7 +370,7 @@ export default function ContactForm({ }; // Get Tax ID label based on detected country - const taxIdLabel = getTaxIdLabel(phoneCountry, formData.type); + const taxIdLabel = getTaxIdLabel(phoneCountry, taxIdType); return (
@@ -381,7 +383,7 @@ export default function ContactForm({