working on course details again

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-04 06:24:14 +08:00
parent 1d7d778a98
commit beae8ce633
@@ -1,5 +1,9 @@
import { Eye, Archive, SquarePlus, SquareChartGantt } from "lucide-react";
// duration_seconds is derived from the lesson's authored content blocks
// (see duration.util.js) — zero means no page content exists yet.
const hasContent = (row) => !!row.duration_seconds;
export function buildRowActions({ onCreatePage, onViewPage, onView, onArchive }) {
return [
{
@@ -9,19 +13,30 @@ export function buildRowActions({ onCreatePage, onViewPage, onView, onArchive })
onClick: (row) => onView(row),
},
{
key: "edit",
key: "create_content",
label: "Create Content",
icon: <SquarePlus className="h-3.5 w-3.5" />,
className: "text-sky-700 hover:text-sky-600",
onClick: (row) => onCreatePage(row),
hidden: (row) => hasContent(row),
separator: true,
},
{
key: "view_content",
label: "View Content",
icon: <SquareChartGantt className="h-3.5 w-3.5" />,
className: "text-sky-700 hover:text-sky-600",
onClick: (row) => onViewPage(row),
hidden: (row) => !hasContent(row),
separator: true,
},
{
key: "edit",
key: "modify_content",
label: "Modify Content",
icon: <SquarePlus className="h-3.5 w-3.5" />,
className: "text-sky-700 hover:text-sky-600",
onClick: (row) => onCreatePage(row),
hidden: (row) => !hasContent(row),
},
{
key: "archive",