mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user