93 lines
4.7 KiB
TypeScript
93 lines
4.7 KiB
TypeScript
import { NoData } from '@/shared/ui/no-data';
|
|
import {
|
|
// Button,
|
|
// Label,
|
|
// Select,
|
|
// SelectTrigger,
|
|
// SelectContent,
|
|
// SelectValue,
|
|
// SelectItem,
|
|
Input,
|
|
Table,
|
|
TableBody,
|
|
TableCell,
|
|
TableHead,
|
|
TableRow,
|
|
} from "@common/components";
|
|
import { FormItem, FormControl, FormField, Form } from "@/shared/ui/form";
|
|
|
|
import { type UseFormReturn } from "react-hook-form";
|
|
|
|
import type { GeneralverificationList } from '@/entities/statistics/model/general-verification-interface';
|
|
import { type GeneralVerificationMasterSubmitFormData } from '@/entities/statistics/model/general-verification-master-submit-schema';
|
|
|
|
interface DetailComponentProps {
|
|
selectedVrfcRow: GeneralverificationList | null;
|
|
form: UseFormReturn<GeneralVerificationMasterSubmitFormData>;
|
|
}
|
|
|
|
const DetailComponent = ({ selectedVrfcRow, form }: DetailComponentProps) => {
|
|
return (
|
|
<div className='card card-border w-1/2 !mx-0 flex flex-col'>
|
|
<div className="card-header">
|
|
<h3 className="text-2xl font-medium text-label">검증 상세 정보</h3>
|
|
</div>
|
|
<div className="card !m-4 h-full overflow-auto !p-0">
|
|
{selectedVrfcRow ?
|
|
<>
|
|
<div className='flex flex-col'>
|
|
<Form {...form}>
|
|
<form>
|
|
<div>
|
|
<Table variant="secondary" className="table-fixed">
|
|
<colgroup>
|
|
<col width="25%" />
|
|
<col width="25%" />
|
|
<col width="25%" />
|
|
<col width="25%" />
|
|
</colgroup>
|
|
<TableBody>
|
|
<TableRow>
|
|
<TableHead>* 검증명</TableHead>
|
|
<TableCell>
|
|
<FormField
|
|
control={form.control}
|
|
name="vrfcNm"
|
|
render={({ field }) => (
|
|
<FormItem>
|
|
<FormControl>
|
|
<Input
|
|
{...field}
|
|
value={field.value ?? ""}
|
|
className="!text-[1.3rem] w-full min-w-0"
|
|
autoComplete="off"
|
|
/>
|
|
</FormControl>
|
|
{form.formState.errors.vrfcNm && (
|
|
<p className="text-red-500 text-base pt-2">
|
|
{form.formState.errors.vrfcNm.message}
|
|
</p>
|
|
)}
|
|
</FormItem>
|
|
)}
|
|
/>
|
|
</TableCell>
|
|
<TableHead>* 통계항목</TableHead>
|
|
<TableCell className='text-center'>{(selectedVrfcRow as GeneralverificationList)?.trgtStatsNm ?? "-"}</TableCell>
|
|
</TableRow>
|
|
</TableBody>
|
|
</Table>
|
|
</div>
|
|
</form>
|
|
</Form>
|
|
</div>
|
|
</>
|
|
:
|
|
<NoData />
|
|
}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default DetailComponent; |