@ducor/react
Version:
admin template ui interface
21 lines (20 loc) • 1.08 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { twMerge } from "tailwind-merge";
//
var Alert = function (_a) {
var message = _a.message, description = _a.description, _b = _a.type, type = _b === void 0 ? "info" : _b, showIcon = _a.showIcon;
var typeStyles = {
success: "bg-green-100 border-green-500 text-green-700",
info: "bg-blue-100 border-blue-500 text-blue-700",
warning: "bg-yellow-100 border-yellow-500 text-yellow-700",
error: "bg-red-100 border-red-500 text-red-700",
};
var icons = {
success: "✅",
info: "ℹ️",
warning: "⚠️",
error: "❌",
};
return (_jsxs("div", { className: twMerge("flex items-start p-4 border-l-4 rounded-md", typeStyles[type]), children: [showIcon && _jsx("span", { className: 'mr-3 text-lg', children: icons[type] }), _jsxs("div", { children: [_jsx("p", { className: 'font-semibold', children: message }), description && _jsx("p", { className: 'mt-1 text-sm', children: description })] })] }));
};
export default Alert;