add: more things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-04 06:48:04 +08:00
parent 8c4e3ef118
commit 536c644623
3 changed files with 141 additions and 1 deletions
@@ -0,0 +1,50 @@
// ─── components/generic/Dialogs/Client/InfoDialog.jsx ────────────────────────
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogDescription,
DialogFooter,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { Info } from "lucide-react";
/**
* Generic one-time informational dialog for client-side validation notices —
* e.g. "this course has no assessment yet". Purely informational: a single
* acknowledgement button, no destructive action.
*
* Usage:
* <InfoDialog
* open={open}
* onOpenChange={setOpen}
* title="Assessment Coming Soon"
* description="This course does not have an assessment built yet…"
* />
*/
export function InfoDialog({
open,
onOpenChange,
title,
description,
icon: Icon = Info,
actionLabel = "Continue",
}) {
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-sm">
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<Icon className="size-4 text-muted-foreground shrink-0" />
{title}
</DialogTitle>
<DialogDescription className="text-left">{description}</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button onClick={() => onOpenChange(false)}>{actionLabel}</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}