const types = {
error: {
backgroundColor: "bg-red-50",
titleColor: "text-red-800",
detailsColor: "text-red-700",
iconColor: "text-red-400",
icon: (
),
},
info: {
backgroundColor: "bg-blue-50",
titleColor: "text-blue-800",
detailsColor: "text-blue-700",
iconColor: "text-blue-400",
icon: (
),
},
};
export default function Message({ type = "info", title, items = [] }) {
const { backgroundColor, titleColor, detailsColor, iconColor, icon } = types[type];
return (
{title &&
{title}
}
{items.length > 0 && (
1 ? "list-disc pl-5 space-y-1" : ""}`}>
{items.map((item, index) => (
- {item}
))}
)}
);
}