seed keywords
This commit is contained in:
@@ -133,6 +133,15 @@ interface TablePageTemplateProps {
|
||||
onRowAction?: (actionKey: string, row: any) => Promise<void>;
|
||||
getItemDisplayName?: (row: any) => string; // Function to get display name from row (e.g., row.keyword or row.name)
|
||||
className?: string;
|
||||
// Custom actions to display in action buttons area (near column selector)
|
||||
customActions?: ReactNode;
|
||||
// Custom bulk actions configuration (overrides table-actions.config.ts)
|
||||
bulkActions?: Array<{
|
||||
key: string;
|
||||
label: string;
|
||||
icon?: ReactNode;
|
||||
variant?: 'primary' | 'success' | 'danger';
|
||||
}>;
|
||||
}
|
||||
|
||||
export default function TablePageTemplate({
|
||||
@@ -167,6 +176,8 @@ export default function TablePageTemplate({
|
||||
onExport,
|
||||
getItemDisplayName = (row: any) => row.name || row.keyword || row.title || String(row.id),
|
||||
className = '',
|
||||
customActions,
|
||||
bulkActions: customBulkActions,
|
||||
}: TablePageTemplateProps) {
|
||||
const location = useLocation();
|
||||
const [isBulkActionsDropdownOpen, setIsBulkActionsDropdownOpen] = useState(false);
|
||||
@@ -181,7 +192,8 @@ export default function TablePageTemplate({
|
||||
|
||||
// Get actions from config (edit/delete always included)
|
||||
const rowActions = tableActionsConfig?.rowActions || [];
|
||||
const bulkActions = tableActionsConfig?.bulkActions || [];
|
||||
// Use custom bulk actions if provided, otherwise use config
|
||||
const bulkActions = customBulkActions || tableActionsConfig?.bulkActions || [];
|
||||
|
||||
// Selection and expanded rows state
|
||||
const [selectedIds, setSelectedIds] = useState<string[]>(selection?.selectedIds || []);
|
||||
@@ -737,6 +749,9 @@ export default function TablePageTemplate({
|
||||
|
||||
{/* Action Buttons - Right aligned */}
|
||||
<div className="flex gap-2 items-center">
|
||||
{/* Custom Actions */}
|
||||
{customActions}
|
||||
|
||||
{/* Column Selector */}
|
||||
<ColumnSelector
|
||||
columns={columns.map(col => ({
|
||||
|
||||
Reference in New Issue
Block a user