turash/bugulma/frontend/components/add-organization/steps/LocationSection.tsx
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- Remove nested git repository from bugulma/frontend/.git
- Add all frontend files to main repository tracking
- Convert from separate frontend/backend repos to unified monorepo
- Preserve all frontend code and development history as tracked files
- Eliminate nested repository complexity for simpler development workflow

This creates a proper monorepo structure with frontend and backend
coexisting in the same repository for easier development and deployment.
2025-11-25 06:02:57 +01:00

70 lines
1.9 KiB
TypeScript

/**
* Location Section for Organization Creation
* Handles location/map selection and coordinates
* Separated from main Step1 component for better SRP
*/
import React from 'react';
import { Control, FieldErrors, UseFormWatch, UseFormSetValue } from 'react-hook-form';
import { OrganizationFormData } from '@/types.ts';
import { useTranslation } from '@/hooks/useI18n.tsx';
import FormField from '@/components/form/FormField.tsx';
import Input from '@/components/ui/Input.tsx';
import MapPicker from '@/components/ui/MapPicker.tsx';
interface LocationSectionProps {
control: Control<OrganizationFormData>;
errors: FieldErrors<OrganizationFormData>;
watch: UseFormWatch<OrganizationFormData>;
setValue: UseFormSetValue<OrganizationFormData>;
}
export const LocationSection: React.FC<LocationSectionProps> = ({
control,
errors,
watch,
setValue,
}) => {
const { t } = useTranslation();
return (
<div className="space-y-6">
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<FormField
control={control}
errors={errors}
name="location.lat"
label={t('addOrgWizard.step1.latitude')}
component={Input}
type="number"
step="any"
placeholder={t('addOrgWizard.step1.latitudePlaceholder')}
required
/>
<FormField
control={control}
errors={errors}
name="location.lng"
label={t('addOrgWizard.step1.longitude')}
component={Input}
type="number"
step="any"
placeholder={t('addOrgWizard.step1.longitudePlaceholder')}
required
/>
</div>
<FormField
control={control}
errors={errors}
name="location"
label={t('addOrgWizard.step1.location')}
component={MapPicker}
setValue={setValue}
watch={watch}
required
/>
</div>
);
};