mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
Some checks failed
CI/CD Pipeline / backend-lint (push) Failing after 31s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Failing after 1m22s
CI/CD Pipeline / frontend-build (push) Has been skipped
CI/CD Pipeline / e2e-test (push) Has been skipped
- Fix React Compiler memoization issues in useOrganizationPage.ts - Replace useCallback with useRef pattern in useKeyboard.ts - Remove unnecessary dependencies from useMemo hooks - Fix prettier formatting in api-client.ts and api-config.ts - Replace any types with proper types in error-handling, http-client, security - Remove unused imports and variables - Move ImpactBreakdownChart component outside render in ImpactMetrics.tsx - Fix setState in effect by using useMemo in HeritageBuildingPage.tsx - Memoize getHistoryTitle with useCallback in MatchDetailPage and MatchNegotiationPage - Add i18n for literal strings in community pages and LoginPage - Fix missing dependencies in DashboardPage and DiscoveryPage
85 lines
2.6 KiB
TypeScript
85 lines
2.6 KiB
TypeScript
import { Control, FieldErrors, UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
import { OrganizationFormData } from '@/types.ts';
|
|
import { useTranslation } from '@/hooks/useI18n.tsx';
|
|
import FormField from '@/components/form/FormField.tsx';
|
|
import ImageGallery from '@/components/ui/ImageGallery.tsx';
|
|
import ImageUpload from '@/components/ui/ImageUpload.tsx';
|
|
import { BasicInfoSection } from '@/components/add-organization/steps/BasicInfoSection.tsx';
|
|
import { LocationSection } from '@/components/add-organization/steps/LocationSection.tsx';
|
|
import { TagsSection } from '@/components/add-organization/steps/TagsSection.tsx';
|
|
|
|
interface Step1Props {
|
|
control: Control<OrganizationFormData>;
|
|
errors: FieldErrors<OrganizationFormData>;
|
|
watch: UseFormWatch<OrganizationFormData>;
|
|
setValue: UseFormSetValue<OrganizationFormData>;
|
|
generateDescription: (payload: [string, string, string]) => void;
|
|
isGenerating: boolean;
|
|
}
|
|
|
|
const Step1 = ({
|
|
control,
|
|
errors,
|
|
watch,
|
|
setValue,
|
|
generateDescription,
|
|
isGenerating,
|
|
}: Step1Props) => {
|
|
const { t } = useTranslation();
|
|
return (
|
|
<div className="space-y-8">
|
|
{/* Basic Information */}
|
|
<BasicInfoSection
|
|
control={control}
|
|
errors={errors}
|
|
watch={watch}
|
|
generateDescription={generateDescription}
|
|
isGenerating={isGenerating}
|
|
/>
|
|
|
|
{/* Location */}
|
|
<LocationSection control={control} errors={errors} watch={watch} setValue={setValue} />
|
|
|
|
{/* Tags and Business Focus */}
|
|
<TagsSection control={control} errors={errors} setValue={setValue} />
|
|
|
|
{/* Logo Upload */}
|
|
<div>
|
|
<h3 className="text-lg font-semibold mb-4">{t('organization.logo')}</h3>
|
|
<FormField
|
|
control={control}
|
|
errors={errors}
|
|
name="logoUrl"
|
|
label="Logo"
|
|
component={ImageUpload}
|
|
/>
|
|
</div>
|
|
|
|
{/* Gallery Images */}
|
|
<div>
|
|
<h3 className="text-lg font-semibold mb-4">{t('organization.galleryImages')}</h3>
|
|
<FormField
|
|
control={control}
|
|
errors={errors}
|
|
name="galleryImages"
|
|
label="Gallery Images"
|
|
component={(props: { value?: string[]; onChange?: (images: string[]) => void }) => (
|
|
<ImageGallery
|
|
images={props.value || []}
|
|
onChange={props.onChange}
|
|
maxImages={10}
|
|
editable={true}
|
|
className="w-full"
|
|
/>
|
|
)}
|
|
/>
|
|
<p className="text-sm text-muted-foreground mt-2">
|
|
{t('organization.galleryImagesHint')}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Step1;
|