import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Space, Title, useMantineTheme } from "@mantine/core";
import { Prism } from "@mantine/prism";
import { Analytics, EventAction, EventCategory } from "../../../utils";
var interfaceCodeBlock = "\n\n   export interface TableProps<T> {\n  // required props\n  columns: ColumnDef<T>[];\n  data: TableOption<T>[];\n  tableName: string;\n\n  // crud props\n  disableCrud?: boolean;\n  crudOptions?: {\n    tableRowObject?: T;\n    onEditSaveRow?: (id: string, values: Partial<T>) => Promise<boolean | null>;\n    onCreateRow?: (values: Partial<T>) => Promise<boolean | null>;\n    setTableRowObject?: (row: T) => void;\n    onDeleteRow?: (args: T) => Promise<void>;\n  }\n\n  // pagination related props\n  disablePagination?: boolean;\n  setTableConfig?: (values: TableConfigData<T>) => void;\n  totalRecords?: number;\n\n  // table UI related props\n  renderDetailPanel?: (row: T) => ReactNode;\n  rowActionsPosition?: \"start\" | \"end\";\n  rowActionMenuItems?: RowActionMenuItem<T>[];\n  hideOuterBorder?: boolean;\n\n  // generic table props\n  tableOptions?: Partial<TableOptions<T>>;\n  isLoading?: boolean;\n  reloadFn?: () => void;\n  onDoubleClickRow?: (row: T) => void;\n  EmptyStateComponent?: ReactNode;\n  debugRows?: boolean;\n}\n\n\n ";
export var TableInterfaceSnippet = function () {
    var theme = useMantineTheme();
    var onCodeCopy = function () {
        Analytics.trackEvent({
            category: EventCategory.TableProps,
            action: EventAction.CodeSnippetCopy,
        });
    };
    return (_jsxs(Box, { mx: 32, children: [_jsx(Title, { order: 3, my: 20, color: theme.colorScheme === "dark"
                    ? theme.colors.blue[3]
                    : theme.colors.blue[7], children: "Table Interface" }), _jsx(Box, { className: "snnipet-text", my: 32, mr: 48, children: _jsx(Prism, { withLineNumbers: true, language: "tsx", onCopy: onCodeCopy, children: interfaceCodeBlock }) }), _jsx(Space, { h: 10 })] }));
};
