외부 커넥션 관리 ~ 테스트

This commit is contained in:
hyeonsu
2025-09-19 12:15:14 +09:00
parent 8e2bb1d9a0
commit efb08b0103
9 changed files with 1190 additions and 401 deletions

View File

@@ -0,0 +1,26 @@
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 };
};