"use client";

import { useTheme } from "next-themes";
import { Toaster as SonnerToaster } from "sonner";

export function Toaster() {
  const { theme = "system" } = useTheme();

  return (
    <SonnerToaster
      position="bottom-center"
      theme={theme as "light" | "dark" | "system"}
      closeButton
      richColors
      duration={2500}
      toastOptions={{
        classNames: {
          toast: "sonner-toast-snackbar",
          success: "sonner-toast-success",
          error: "sonner-toast-error",
          warning: "sonner-toast-warning",
          info: "sonner-toast-info",
          closeButton: "sonner-close-btn",
        },
      }}
    />
  );
}
