"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusBadge = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@chakra-ui/react");
const icons_1 = require("@chakra-ui/icons");
const STATUS_CONFIG = {
    online: {
        colorScheme: 'green',
        icon: icons_1.CheckCircleIcon,
        label: 'Online',
    },
    offline: {
        colorScheme: 'red',
        icon: icons_1.NotAllowedIcon,
        label: 'Offline',
    },
    maintenance: {
        colorScheme: 'yellow',
        icon: icons_1.TimeIcon,
        label: 'Maintenance',
    },
    error: {
        colorScheme: 'red',
        icon: icons_1.WarningIcon,
        label: 'Error',
    },
    active: {
        colorScheme: 'green',
        icon: icons_1.CheckCircleIcon,
        label: 'Active',
    },
    inactive: {
        colorScheme: 'gray',
        icon: icons_1.NotAllowedIcon,
        label: 'Inactive',
    },
    draft: {
        colorScheme: 'gray',
        icon: icons_1.TimeIcon,
        label: 'Draft',
    },
    published: {
        colorScheme: 'green',
        icon: icons_1.CheckCircleIcon,
        label: 'Published',
    },
    archived: {
        colorScheme: 'gray',
        icon: icons_1.NotAllowedIcon,
        label: 'Archived',
    },
    training: {
        colorScheme: 'blue',
        icon: icons_1.TimeIcon,
        label: 'Training',
    },
};
const StatusBadge = ({ status, showIcon = true, ...props }) => {
    const config = STATUS_CONFIG[status.toLowerCase()] || {
        colorScheme: 'gray',
        icon: icons_1.TimeIcon,
        label: status,
    };
    const Icon = config.icon;
    return ((0, jsx_runtime_1.jsxs)(react_1.Badge, { colorScheme: config.colorScheme, display: "inline-flex", alignItems: "center", gap: 1, px: 2, py: 0.5, borderRadius: "full", textTransform: "capitalize", fontSize: "xs", fontWeight: "medium", ...props, children: [showIcon && (0, jsx_runtime_1.jsx)(Icon, { boxSize: 3 }), config.label] }));
};
exports.StatusBadge = StatusBadge;
exports.default = exports.StatusBadge;
//# sourceMappingURL=StatusBadge.js.map