diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
| commit | ef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch) | |
| tree | 345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/vendor-candidates/table/candidates-table.tsx | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/vendor-candidates/table/candidates-table.tsx')
| -rw-r--r-- | lib/vendor-candidates/table/candidates-table.tsx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/vendor-candidates/table/candidates-table.tsx b/lib/vendor-candidates/table/candidates-table.tsx index 2c01733c..e36649b5 100644 --- a/lib/vendor-candidates/table/candidates-table.tsx +++ b/lib/vendor-candidates/table/candidates-table.tsx @@ -11,17 +11,17 @@ import { toSentenceCase } from "@/lib/utils" import { useDataTable } from "@/hooks/use-data-table" import { DataTable } from "@/components/data-table/data-table" import { DataTableAdvancedToolbar } from "@/components/data-table/data-table-advanced-toolbar" -import { DataTableToolbar } from "@/components/data-table/data-table-toolbar" import { useFeatureFlags } from "./feature-flags-provider" import { getVendorCandidateCounts, getVendorCandidates } from "../service" -import { VendorCandidates, vendorCandidates } from "@/db/schema/vendors" +import { vendorCandidates ,VendorCandidatesWithVendorInfo} from "@/db/schema/vendors" import { VendorCandidateTableFloatingBar } from "./candidates-table-floating-bar" import { getColumns } from "./candidates-table-columns" import { CandidatesTableToolbarActions } from "./candidates-table-toolbar-actions" import { DeleteCandidatesDialog } from "./delete-candidates-dialog" import { UpdateCandidateSheet } from "./update-candidate-sheet" import { getCandidateStatusIcon } from "@/lib/vendor-candidates/utils" +import { ViewCandidateLogsDialog } from "./view-candidate_logs-dialog" interface VendorCandidatesTableProps { promises: Promise< @@ -41,7 +41,7 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { const [rowAction, setRowAction] = - React.useState<DataTableRowAction<VendorCandidates> | null>(null) + React.useState<DataTableRowAction<VendorCandidatesWithVendorInfo> | null>(null) const columns = React.useMemo( () => getColumns({ setRowAction }), @@ -59,7 +59,7 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { * @prop {React.ReactNode} [icon] - An optional icon to display next to the label. * @prop {boolean} [withCount] - An optional boolean to display the count of the filter option. */ - const filterFields: DataTableFilterField<VendorCandidates>[] = [ + const filterFields: DataTableFilterField<VendorCandidatesWithVendorInfo>[] = [ { id: "status", @@ -83,7 +83,7 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { * 3. Used with DataTableAdvancedToolbar: Enables a more sophisticated filtering UI. * 4. Date and boolean types: Adds support for filtering by date ranges and boolean values. */ - const advancedFilterFields: DataTableAdvancedFilterField<VendorCandidates>[] = [ + const advancedFilterFields: DataTableAdvancedFilterField<VendorCandidatesWithVendorInfo>[] = [ { id: "companyName", label: "Company Name", @@ -109,7 +109,7 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { label: "Status", type: "multi-select", options: vendorCandidates.status.enumValues.map((status) => ({ - label: toSentenceCase(status), + label: (status), value: status, icon: getCandidateStatusIcon(status), count: statusCounts[status], @@ -118,7 +118,7 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { { id: "createdAt", - label: "Created at", + label: "수집일", type: "date", }, ] @@ -168,6 +168,11 @@ export function VendorCandidateTable({ promises }: VendorCandidatesTableProps) { showTrigger={false} onSuccess={() => rowAction?.row.toggleSelected(false)} /> + <ViewCandidateLogsDialog + open={rowAction?.type === "log"} + onOpenChange={() => setRowAction(null)} + candidateId={rowAction?.row.original?.id ?? null} + /> </> ) } |
