Uecko_ERP/modules/customers/src/web/components/editor/customer-additional-config-fields.tsx

51 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-09-21 19:46:51 +00:00
import { SelectField } from "@repo/rdx-ui/components";
2025-09-18 09:46:25 +00:00
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@repo/shadcn-ui/components";
2025-09-22 17:43:55 +00:00
import { useFormContext } from "react-hook-form";
2025-09-18 09:46:25 +00:00
import { CURRENCY_OPTIONS, LANGUAGE_OPTIONS } from "../../constants";
import { useTranslation } from "../../i18n";
2025-09-23 17:21:16 +00:00
import { CustomerFormData } from "../../schemas";
2025-09-18 09:46:25 +00:00
2025-09-22 17:43:55 +00:00
export const CustomerAdditionalConfigFields = () => {
2025-09-18 09:46:25 +00:00
const { t } = useTranslation();
2025-09-23 17:21:16 +00:00
const { control } = useFormContext<CustomerFormData>();
2025-09-18 09:46:25 +00:00
return (
2025-09-21 19:10:05 +00:00
<Card className='border-0 shadow-none'>
2025-09-18 09:46:25 +00:00
<CardHeader>
2025-09-19 16:55:30 +00:00
<CardTitle>{t("form_groups.preferences.title")}</CardTitle>
<CardDescription>{t("form_groups.preferences.description")}</CardDescription>
2025-09-18 09:46:25 +00:00
</CardHeader>
2025-09-21 19:46:51 +00:00
<CardContent>
<div className='grid grid-cols-1 gap-6 lg:grid-cols-4 mb-12 '>
<SelectField
className='lg:col-span-2'
control={control}
name='language_code'
required
label={t("form_fields.language_code.label")}
placeholder={t("form_fields.language_code.placeholder")}
description={t("form_fields.language_code.description")}
items={[...LANGUAGE_OPTIONS]}
/>
<SelectField
className='lg:col-span-2'
control={control}
name='currency_code'
required
label={t("form_fields.currency_code.label")}
placeholder={t("form_fields.currency_code.placeholder")}
description={t("form_fields.currency_code.description")}
items={[...CURRENCY_OPTIONS]}
/>
</div>
2025-09-18 09:46:25 +00:00
</CardContent>
</Card>
);
2025-09-19 16:55:30 +00:00
};