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 (
{bundleCount} {mode === "soal" ? "soal" : "section"} dipilih
{lockedExamType && ({isQ ? `${item.examTypeName} \u00B7 ${formatLabel(item.format ?? "")}` : `${item.examTypeName} \u00B7 ${item.sectionTypeName}`}
Auto Bundle
AI pilihkan soal otomatis