import { Button } from "@/src/components/ui/button"; import { useSupportDrawer } from "@/src/features/support-chat/SupportDrawerProvider"; import { AlertTriangle, X } from "lucide-react"; interface ErrorNotificationProps { error: string; description: string; type: "WARNING" | "ERROR"; dismissToast: (t?: string | number | undefined) => void; toast: string | number; path?: string; } export const ErrorNotification: React.FC = ({ error, description, type, dismissToast, toast, path, }) => { const { setOpen } = useSupportDrawer(); const isError = type === "ERROR"; const textColor = isError ? "text-destructive-foreground" : "text-dark-yellow"; // const handleReportIssueClick = () => { // if (chatAvailable) { // const currentUrl = window.location.href; // const message = `I received the following error:\n\nError: ${error}\nDescription: ${description}\n ${path ? `Path: ${path}\n` : ""}URL: ${currentUrl}`; // sendUserChatMessage(message); // dismissToast(toast); // } // }; return (
{error}
{description && (
{description}
)} {path && (
Path: {path}
)} {isError && ( )}
); };