import { Select, Stack, Text, Textarea, TextInput } from "@mantine/core"; import { DateInput } from "@mantine/dates"; import type { FC } from "react"; import { Controller, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { type BankOperation, bankDateInputValue, bankDateSchema, bankToday, } from "@/entities/bank-card"; import { formatMoney } from "@/shared/lib"; import type { OperationValues } from "./OperationForm.types"; type Choice = { value: string; label: string }; type OperationFieldsProps = { editing: boolean; refundCardId: string; kind: OperationValues["kind"]; cards: Choice[]; targets: Choice[]; categories: Choice[]; defaultCategory: string; }; const OperationFields: FC = (props) => { const { t } = useTranslation(); const { control, register, setValue, formState: { errors, isSubmitting }, } = useFormContext(); return ( ( )} /> {props.kind === "transfer" && ( ( )} /> )}