chore: heygermany customer project
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled

This commit is contained in:
e2e
2026-07-11 11:03:59 +02:00
commit 36f1b746bd
370 changed files with 35585 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import React, { useMemo } from 'react'
import { Select } from '@pikku/mantine/core'
import { useGetCountries } from '@/hooks/useGetCountries'
interface CountrySearchProps {
value: string
onChange: (value: string) => void
error?: string
label?: any
placeholder?: any
}
export const CountrySearch: React.FunctionComponent<CountrySearchProps> = ({
value,
onChange,
error,
label,
placeholder
}) => {
const { data: countriesMap = {}, isLoading } = useGetCountries()
const countryOptions = useMemo(() => {
return Object.entries(countriesMap).map(([iso3, name]) => ({
value: iso3,
label: name
}))
}, [countriesMap])
return (
<Select
label={label as any}
value={value}
data={countryOptions}
onChange={(selectedValue) => onChange(selectedValue || '')}
placeholder={placeholder as any}
searchable
error={error as any}
disabled={isLoading && countryOptions.length === 0}
/>
)
}