mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
working on course details again
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
import { Eye, Archive, SquarePlus, SquareChartGantt } from "lucide-react";
|
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 }) {
|
export function buildRowActions({ onCreatePage, onViewPage, onView, onArchive }) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -9,19 +13,30 @@ export function buildRowActions({ onCreatePage, onViewPage, onView, onArchive })
|
|||||||
onClick: (row) => onView(row),
|
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",
|
label: "View Content",
|
||||||
icon: <SquareChartGantt className="h-3.5 w-3.5" />,
|
icon: <SquareChartGantt className="h-3.5 w-3.5" />,
|
||||||
className: "text-sky-700 hover:text-sky-600",
|
className: "text-sky-700 hover:text-sky-600",
|
||||||
onClick: (row) => onViewPage(row),
|
onClick: (row) => onViewPage(row),
|
||||||
|
hidden: (row) => !hasContent(row),
|
||||||
separator: true,
|
separator: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "edit",
|
key: "modify_content",
|
||||||
label: "Modify Content",
|
label: "Modify Content",
|
||||||
icon: <SquarePlus className="h-3.5 w-3.5" />,
|
icon: <SquarePlus className="h-3.5 w-3.5" />,
|
||||||
className: "text-sky-700 hover:text-sky-600",
|
className: "text-sky-700 hover:text-sky-600",
|
||||||
onClick: (row) => onCreatePage(row),
|
onClick: (row) => onCreatePage(row),
|
||||||
|
hidden: (row) => !hasContent(row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "archive",
|
key: "archive",
|
||||||
|
|||||||
Reference in New Issue
Block a user