43 lines
829 B
TypeScript
43 lines
829 B
TypeScript
"use client";
|
|
|
|
import { CircleCheck, CircleAlert, BadgeCheck } from "lucide-react";
|
|
import clsx from "clsx";
|
|
|
|
export interface PropsIconToastifyCustom {
|
|
type: "success" | "info" | "warn" | "error";
|
|
}
|
|
|
|
const ICON_CONFIG = {
|
|
success: {
|
|
bg: "bg-[#06d7a0]",
|
|
icon: CircleCheck,
|
|
},
|
|
info: {
|
|
bg: "bg-[#4bc9f0]",
|
|
icon: CircleCheck,
|
|
},
|
|
warn: {
|
|
bg: "bg-[#ffd167]",
|
|
icon: CircleAlert,
|
|
},
|
|
error: {
|
|
bg: "bg-[#ee464c]",
|
|
icon: BadgeCheck,
|
|
},
|
|
} as const;
|
|
|
|
export default function IconToastifyCustom({ type }: PropsIconToastifyCustom) {
|
|
const { bg, icon: Icon } = ICON_CONFIG[type];
|
|
|
|
return (
|
|
<div
|
|
className={clsx(
|
|
"w-[50px] h-[50px] flex items-center justify-center rounded-full",
|
|
bg,
|
|
)}
|
|
>
|
|
<Icon size={20} className="text-white" />
|
|
</div>
|
|
);
|
|
}
|