feat: Add country selection dropdown with predefined options in company profile form
This commit is contained in:
parent
8798979fe9
commit
d96f13474c
@ -21,6 +21,16 @@ interface CompanyProfileData {
|
||||
emergencyPhone: string
|
||||
}
|
||||
|
||||
// Common countries list
|
||||
const COUNTRIES = [
|
||||
'Germany', 'Austria', 'Switzerland', 'Italy', 'France', 'Spain', 'Portugal', 'Netherlands',
|
||||
'Belgium', 'Poland', 'Czech Republic', 'Hungary', 'Croatia', 'Slovenia', 'Slovakia',
|
||||
'United Kingdom', 'Ireland', 'Sweden', 'Norway', 'Denmark', 'Finland', 'Russia',
|
||||
'Turkey', 'Greece', 'Romania', 'Bulgaria', 'Serbia', 'Albania', 'Bosnia and Herzegovina',
|
||||
'United States', 'Canada', 'Brazil', 'Argentina', 'Mexico', 'China', 'Japan',
|
||||
'India', 'Pakistan', 'Australia', 'South Africa', 'Other'
|
||||
]
|
||||
|
||||
const init: CompanyProfileData = {
|
||||
companyName: '',
|
||||
vatNumber: '',
|
||||
@ -46,7 +56,7 @@ export default function CompanyAdditionalInformationPage() {
|
||||
const [success, setSuccess] = useState(false)
|
||||
const [error, setError] = useState('')
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => {
|
||||
const { name, value } = e.target
|
||||
setForm(p => ({ ...p, [name]: value }))
|
||||
setError('')
|
||||
@ -231,13 +241,20 @@ export default function CompanyAdditionalInformationPage() {
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
Country *
|
||||
</label>
|
||||
<input
|
||||
<select
|
||||
name="country"
|
||||
value={form.country}
|
||||
onChange={handleChange}
|
||||
className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent"
|
||||
required
|
||||
/>
|
||||
>
|
||||
<option value="">Select country...</option>
|
||||
{COUNTRIES.map(country => (
|
||||
<option key={country} value={country}>
|
||||
{country}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user