mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-09 09:28:21 +00:00
Resolved by unifying on the lib/data AdvancedTable (PR #10) as the canonical table component: kept its API plus teammate i18n/feature work, kept the folder-per-table structure (index.tsx + columns.tsx + actions.tsx) across all 27 tables, removed the parallel lib/table implementation, and fixed pre-existing compile breaks in ExamDetailPage/QuestionAssigner/RecordResultModal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
35 lines
940 B
TypeScript
35 lines
940 B
TypeScript
import { ActionIcon, Group } from "@mantine/core";
|
|
import { IconEdit, IconTrash } from "@tabler/icons-react";
|
|
import type { AdvancedColumn } from "@ema-platform/ui";
|
|
import type { Profession } from "../../types/configuration";
|
|
|
|
export function professionActionsColumn(handlers: {
|
|
onEdit: (prof: Profession) => void;
|
|
onDelete: (prof: Profession) => void;
|
|
}): AdvancedColumn<Profession> {
|
|
return {
|
|
header: "actions",
|
|
size: 90,
|
|
cell: ({ row }) => (
|
|
<Group gap="xs">
|
|
<ActionIcon
|
|
variant="subtle"
|
|
color="blue"
|
|
size="sm"
|
|
onClick={() => handlers.onEdit(row.original)}
|
|
>
|
|
<IconEdit size={14} />
|
|
</ActionIcon>
|
|
<ActionIcon
|
|
variant="subtle"
|
|
color="red"
|
|
size="sm"
|
|
onClick={() => handlers.onDelete(row.original)}
|
|
>
|
|
<IconTrash size={14} />
|
|
</ActionIcon>
|
|
</Group>
|
|
),
|
|
};
|
|
}
|