import { useState, useEffect } from "react"; import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogAction, } from "@/components/ui/alert-dialog"; import { AlertTriangle } from "lucide-react"; const enabled = import.meta.env.VITE_START_POP === "true"; const title = import.meta.env.VITE_START_POP_TITLE ?? ""; const info = import.meta.env.VITE_START_POP_INFO ?? ""; const buttonText = import.meta.env.VITE_START_POP_BOUTTON ?? "确定"; export function StartupPopup() { const [open, setOpen] = useState(false); useEffect(() => { if (enabled) { setOpen(true); } }, []); if (!enabled) return null; return (
{title} {info}
setOpen(false)}> {buttonText}
); }