import { Card, CardContent } from "@pram/ui/components/card"; import { Button } from "@pram/ui/components/button"; import { MaterialIcon } from "@/components/ui/MaterialIcon"; import type { PackageSection } from "@/lib/types"; interface SectionBrowserProps { isLoading: boolean; groupedSections: Record; isSectionInBundle: (id: string) => boolean; onToggleSection: (s: PackageSection) => void; } export function SectionBrowser({ isLoading, groupedSections, isSectionInBundle, onToggleSection, }: SectionBrowserProps) { if (isLoading) { return (
{Array.from({ length: 4 }).map((_, i) => ( ))}
); } if (Object.keys(groupedSections).length === 0) { return (

Tidak ada section ditemukan

); } return (
{Object.entries(groupedSections).map(([groupKey, groupSections]) => (

{groupKey}

{groupSections.map((s) => { const inBundle = isSectionInBundle(s.id); return (

{s.title}

{s.sectionTypeName}
); })}
))}
); }