import { toast as sonnerToast } from "sonner";

interface ToastOptions {
  title?: string;
  description?: string;
  variant?: "default" | "destructive";
  duration?: number;
}

export const useToast = () => {
  const toast = ({ title, description, variant = "default", duration }: ToastOptions) => {
    if (variant === "destructive") {
      sonnerToast.error(title || "오류", {
        description,
        duration: duration || 4000,
      });
    } else {
      sonnerToast.success(title || "성공", {
        description,
        duration: duration || 4000,
      });
    }
  };

  return { toast };
};
