diff --git a/src/modules/admin/config/courses/lessons/rowActions.config.jsx b/src/modules/admin/config/courses/lessons/rowActions.config.jsx index 8bbd5bb..60f08db 100644 --- a/src/modules/admin/config/courses/lessons/rowActions.config.jsx +++ b/src/modules/admin/config/courses/lessons/rowActions.config.jsx @@ -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: , + 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: , 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: , className: "text-sky-700 hover:text-sky-600", onClick: (row) => onCreatePage(row), + hidden: (row) => !hasContent(row), }, { key: "archive",