import { Toaster as Sonner } from "sonner"

type ToasterProps = React.ComponentProps<typeof Sonner>

const Toaster = ({ ...props }: ToasterProps) => {
  return (
    <Sonner
      className="toaster group"
      toastOptions={{
        classNames: {
          toast:
            "group toast group-[.toaster]:bg-white group-[.toaster]:text-gray-900 group-[.toaster]:border group-[.toaster]:border-gray-200 group-[.toaster]:shadow-xl group-[.toaster]:rounded-lg",
          description: "group-[.toast]:text-gray-600 group-[.toast]:whitespace-pre-wrap group-[.toast]:block",
          actionButton:
            "group-[.toast]:bg-gray-900 group-[.toast]:text-white group-[.toast]:hover:bg-gray-800",
          cancelButton:
            "group-[.toast]:bg-gray-100 group-[.toast]:text-gray-700 group-[.toast]:hover:bg-gray-200",
          success: "group-[.toast]:!bg-green-50 group-[.toast]:!text-green-900 group-[.toast]:!border-green-200",
          error: "group-[.toast]:!bg-red-50 group-[.toast]:!text-red-900 group-[.toast]:!border-red-200",
          warning: "group-[.toast]:!bg-amber-50 group-[.toast]:!text-amber-900 group-[.toast]:!border-amber-200",
          info: "group-[.toast]:!bg-blue-50 group-[.toast]:!text-blue-900 group-[.toast]:!border-blue-200",
        },
      }}
      {...props}
    />
  )
}

export { Toaster }
