From beae8ce6338611c6f3cd42c08aa356d57296345d Mon Sep 17 00:00:00 2001 From: Kenneth Obsequio Date: Sat, 4 Jul 2026 06:24:14 +0800 Subject: [PATCH] working on course details again Signed-off-by: Kenneth Obsequio --- .../courses/lessons/rowActions.config.jsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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",