import { Button } from "@pram/ui/components/button"; import { Input } from "@pram/ui/components/input"; import { MaterialIcon } from "@/components/ui/MaterialIcon"; import { formatLabel } from "@/lib/format"; interface BundleItem { id: string; questionText?: string; title?: string; examTypeName?: string | null; format?: string; sectionTypeName?: string | null; } interface BundleSidebarProps { mode: "soal" | "section"; bundleQuestions: BundleItem[]; bundleSections: BundleItem[]; bundleTitle: string; bundleDescription: string; bundleIsPublic: boolean; isCreating: boolean; autoBundleExamType: string | null; lockedExamType?: string | null; onSetTitle: (v: string) => void; onSetDescription: (v: string) => void; onSetIsPublic: (v: boolean) => void; onRemoveFromBundle: (id: string, type: "question" | "section") => void; onCreateFromQuestions: () => void; onCreateFromSections: () => void; onOpenAutoBundle: () => void; } export function BundleSidebar({ mode, bundleQuestions, bundleSections, bundleTitle, bundleDescription, bundleIsPublic, isCreating, autoBundleExamType, lockedExamType, onSetTitle, onSetDescription, onSetIsPublic, onRemoveFromBundle, onCreateFromQuestions, onCreateFromSections, onOpenAutoBundle, }: BundleSidebarProps) { const activeBundle = mode === "soal" ? bundleQuestions : bundleSections; const bundleCount = activeBundle.length; return (
{/* Header */}

Paket Saat Ini

DRAFT

{bundleCount} {mode === "soal" ? "soal" : "section"} dipilih

{lockedExamType && ( {lockedExamType} )}
{/* Items List */}
{bundleCount === 0 ? (
Belum ada yang dipilih
) : ( activeBundle.map((item, idx: number) => { const isQ = mode === "soal"; return (

{isQ ? item.questionText : item.title}

{isQ ? `${item.examTypeName} \u00B7 ${formatLabel(item.format ?? "")}` : `${item.examTypeName} \u00B7 ${item.sectionTypeName}`}

); }) )}
{/* Auto Bundle (only in soal mode) */} {mode === "soal" && (

Auto Bundle

AI pilihkan soal otomatis

)} {/* Form & Actions */}
onSetTitle(e.target.value)} placeholder="Judul paket..." className="w-full bg-[var(--pure-white)] border-2 border-[var(--oat-border)] rounded-[var(--radius-lg)] text-sm" />
onSetDescription(e.target.value)} placeholder="Deskripsi singkat..." className="w-full bg-[var(--pure-white)] border-2 border-[var(--oat-border)] rounded-[var(--radius-lg)] text-sm" />
onSetIsPublic(true)}> Publik onSetIsPublic(false)}> Privat
); } function VisButton({ active, onClick, children }: { active: boolean; onClick: () => void; children: React.ReactNode }) { return ( ); }