feat: make 'name' prop optional in TableList and update breadcrumb structure in TableUI for improved flexibility

This commit is contained in:
faisolavolut 2025-02-26 23:17:37 +07:00
parent 6e0a8b5e4d
commit 520e10f69e
2 changed files with 4 additions and 4 deletions

View File

@ -53,12 +53,12 @@ export interface Column<T = any> {
fm_row?: any; fm_row?: any;
onChange?: (data: any) => void; onChange?: (data: any) => void;
render: () => void; render: () => void;
}) => JSX.Element; }) => JSX.Element | any;
sortable?: boolean; sortable?: boolean;
} }
export interface TableListProps<T extends object> { export interface TableListProps<T extends object> {
autoPagination?: boolean; autoPagination?: boolean;
name: string; name?: string;
column: Column<T>[] | (() => Column<T>[]); column: Column<T>[] | (() => Column<T>[]);
style?: "UI" | "Default"; style?: "UI" | "Default";
align?: "center" | "left" | "right"; align?: "center" | "left" | "right";
@ -103,7 +103,7 @@ export interface FieldFilterProps extends Omit<FieldProps, "fm"> {
export const TableList = <T extends object>({ export const TableList = <T extends object>({
autoPagination = true, autoPagination = true,
name, name = "table",
column, column,
style = "UI", style = "UI",
align = "center", align = "center",

View File

@ -11,7 +11,7 @@ export interface TableUIProps<T extends object> extends TableListProps<T> {
modeTab?: "default" | "only-title"; modeTab?: "default" | "only-title";
tab?: { id: string; name: string; count?: number | null }[]; // ✅ Update count menjadi nullable tab?: { id: string; name: string; count?: number | null }[]; // ✅ Update count menjadi nullable
onTab?: (tabId: any) => void; onTab?: (tabId: any) => void;
breadcrumb?: { label: string; href: string }[]; breadcrumb?: { title?: string; label?: string; url?: string }[];
title?: string; title?: string;
ready?: boolean; ready?: boolean;
} }