'use client' import { useTranslations } from 'next-intl' import { useState } from 'react' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Checkbox } from '@/components/ui/checkbox' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' import { Badge } from '@/components/ui/badge' import type { CompanySettings } from '@/types' interface TaxSettingsFormProps { settings: CompanySettings } export function TaxSettingsForm({ settings }: TaxSettingsFormProps) { const t = useTranslations('settings_tax_form') const [vatRegistered, setVatRegistered] = useState(settings.vat_registered ?? false) const [fSkatt, setFSkatt] = useState(settings.f_skatt ?? true) const [paysSalaries, setPaysSalaries] = useState(settings.pays_salaries ?? false) const isEnskildFirma = settings.entity_type === 'enskild_firma' const months = [ t('month_jan'), t('month_feb'), t('month_mar'), t('month_apr'), t('month_may'), t('month_jun'), t('month_jul'), t('month_aug'), t('month_sep'), t('month_oct'), t('month_nov'), t('month_dec'), ] return (
{/* Entity type — read-only */}

{t('entity_form_heading')}

{settings.entity_type === 'aktiebolag' ? t('entity_aktiebolag') : t('entity_enskild_firma')}

{t('entity_form_help')}

{/* F-skatt */}

{t('tax_vat_heading')}

setFSkatt(v === true)} />

{t('f_skatt_help')}

setVatRegistered(v === true)} />

{t('vat_registered_help')}

{vatRegistered && (

{t('vat_number_help')}

{t('moms_period_help')}

{t('periodisk_help')}

)}
{/* Tax contact — required for SKV-filings */}

{t('tax_contact_heading')}

{t('tax_contact_help')}

{/* Fiscal year & salaries */}

{t('fiscal_year_salaries_heading')}

{isEnskildFirma ? ( <>

{t('fiscal_year_ef_help')}

) : ( <>

{t('fiscal_year_change_help')}

)}
setPaysSalaries(v === true)} />

{t('pays_salaries_help')}

{/* Preliminary tax */}

{t('preliminary_tax_heading')}

{t('preliminary_tax_monthly_help')}

) }