import React from "react"; import { toast } from "sonner"; import { X, AlertTriangle } from "lucide-react"; import { Button } from "./ui/button"; interface InputRequestToastProps { message: string; toastId: string | number; onResponse: (response: "y" | "n") => void; } export function InputRequestToast({ message, toastId, onResponse, }: InputRequestToastProps) { const handleClose = () => { toast.dismiss(toastId); }; const handleResponse = (response: "y" | "n") => { onResponse(response); toast.dismiss(toastId); }; // Clean up the message by removing excessive newlines and whitespace const cleanMessage = message .split("\n") .map((line) => line.trim()) .filter((line) => line.length > 0) .join("\n"); return (
{cleanMessage}