Files
frontend/apps/st/src/components/statistics/management/LogHistory.tsx
T
2026-03-17 10:47:51 +09:00

112 lines
4.0 KiB
TypeScript

"use client";
import { useState } from 'react';
// import useSWR from 'swr';
import {
Button,
// Input,
Label,
// Select,
// SelectTrigger,
// SelectContent,
// SelectItem,
// SelectValue
}
from "@common/components";
import DataGrid from '@/components/module/DataGrid';
import { CodeSelect } from '@/entities/code';
import { LogHistoryColumn } from '@/components/util/column/management/LogHistoryColumn';
// import { LwpoCodeApi } from "@/entities/code";
// const getStateCdListFetcher = async () => {
// return LwpoCodeApi.getLwpoCodeList({
// sort: 'regDt,desc',
// upCd: 'STITEM',
// page: 0,
// size: 100,
// });
// }
const LogHistory = () => {
// const { setMessage: alert } = useAlertStore((state) => state);
const [statsCd, setStatsCd] = useState('');
// const { data: lwpoCdList } = useSWR(
// "lwpo-code-list",
// getStateCdListFetcher,
// {
// revalidateOnFocus: false,
// revalidateOnReconnect: false,
// revalidateIfStale: false,
// dedupingInterval: 2000,
// shouldRetryOnError: false,
// onSuccess: (data) => {
// if (!data.content || data.content.length == 0) {
// alert(`시도 목록을 불러오는데 실패했습니다.
// 새로고침 후 다시 시도해주세요.`);
// }
// },
// onError: () => {
// alert(`시도 목록을 불러오는데 실패했습니다.
// 새로고침 후 다시 시도해주세요.`);
// },
// }
// );
return (
<div className="relative">
<div className="card card-border">
<form>
<div className="flex items-center gap-8 p-2">
<div className="flex items-center gap-2">
<Label className="text-label">
통계항목
</Label>
{/* <Select value={lwpoCd} onValueChange={setLwpoCd}>
<SelectTrigger className="w-[22rem]">
<SelectValue placeholder="전체"></SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="ALL">전체</SelectItem>
{lwpoCdList?.content?.map((l) => (
<SelectItem key={l.lwpoCd} value={l.lwpoCd}>
{l.lwpoCdNm}
</SelectItem>
))}
</SelectContent>
</Select> */}
<CodeSelect
upCd="STITEM"
value={statsCd}
onValueChange={setStatsCd}
placeholder="선택"
className="w-[16rem]"
/>
</div>
<div className="flex items-center gap-2 ml-auto">
<Button color="green" className="h-[3.2rem] w-[96px]" type="button">
초기화
</Button>
<Button className="h-[3.2rem] w-[96px]" type="submit">
조회
</Button>
</div>
</div>
</form>
</div>
<DataGrid
columnInfo={LogHistoryColumn}
// rowStartNum={1}
// fixedColumns={1}
isExcelImport={false}
// showHeaderCheckbox={true}
rowData={[]}
setRowData={() => {}}
/>
</div>
);
};
export default LogHistory;