This commit is contained in:
rgrgogu
2026-05-20 13:25:03 +08:00
parent 2b1955608d
commit 95242709b0
71 changed files with 5535 additions and 1035 deletions
@@ -1,35 +1,41 @@
// config/courses/lessons/rowActions.config.jsx
import { Eye, Pencil, Archive, SquarePlus, SquareChartGantt } from "lucide-react";
import { Eye, Pencil, Trash2 } from "lucide-react";
export function buildRowActions({ onView, onEdit, onArchive }) {
return {
id: "actions",
header: "",
cell: ({ row }) => (
<div className="flex items-center justify-end gap-1">
<button
type="button"
onClick={() => onView(row.original)}
className="p-1.5 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"
>
<Eye className="h-4 w-4" />
</button>
<button
type="button"
onClick={() => onEdit(row.original)}
className="p-1.5 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"
>
<Pencil className="h-4 w-4" />
</button>
<button
type="button"
onClick={() => onArchive(row.original)}
className="p-1.5 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-destructive"
>
<Trash2 className="h-4 w-4" />
</button>
</div>
),
};
export function buildRowActions({ onCreatePage, onViewPage, onView, onEdit, onArchive }) {
return [
{
key: "view",
label: "View Lesson",
icon: <Eye className="h-3.5 w-3.5" />,
onClick: (row) => onView(row),
},
{
key: "edit",
label: "Edit Lesson",
icon: <Pencil className="h-3.5 w-3.5" />,
onClick: (row) => onEdit(row),
},
{
key: "edit",
label: "View Content",
icon: <SquareChartGantt className="h-3.5 w-3.5" />,
className: "text-sky-700 hover:text-sky-600",
onClick: (row) => onViewPage(row),
separator: true,
},
{
key: "edit",
label: "Modify Content",
icon: <SquarePlus className="h-3.5 w-3.5" />,
className: "text-sky-700 hover:text-sky-600",
onClick: (row) => onCreatePage(row),
},
{
key: "archive",
label: "Archive",
icon: <Archive className="h-3.5 w-3.5" />,
className: "text-destructive",
onClick: (row) => onArchive(row),
separator: true
},
]
}