import { type FC } from 'react' import { Location } from 'iconsax-react' import Error from '@/components/Error' type LocationInputProps = { label?: string latitude?: number longitude?: number onClick: () => void error_text?: string } const LocationInput: FC = ({ label, latitude, longitude, onClick, error_text, }) => { const getLocationDisplay = () => { if (latitude && longitude) { return `${latitude.toFixed(6)}, ${longitude.toFixed(6)}` } return 'روی نقشه کلیک کنید' } return (
{label &&
{label}
}
{getLocationDisplay()}
{error_text && ( )}
) } export default LocationInput