'use client'; import React from 'react'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { AdditionalInfo } from '@/components/dashboard/resume-component'; import { useTranslations } from '@/lib/i18n'; interface AdditionalFormProps { data: AdditionalInfo; onChange: (data: AdditionalInfo) => void; } export const AdditionalForm: React.FC = ({ data, onChange }) => { const { t } = useTranslations(); // Helper to handle array conversions (text -> string[]) const handleArrayChange = (field: keyof AdditionalInfo, value: string) => { // Split by newlines only. Blank/whitespace lines are preserved while editing // so pressing Enter creates a new line (issue #763); consumers filter empty // entries at render time, and the backend drops them on save. const items = value.split('\n'); onChange({ ...data, [field]: items, }); }; const formatArray = (arr?: string[]) => { return arr?.join('\n') || ''; }; // Explicitly allow Enter key to create newlines (prevent form submission interference) const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter') { // Allow default behavior (newline insertion) e.stopPropagation(); } }; return (

{t('builder.additionalForm.instructions')}