import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Avatar from '../Avatar';
import CardContainer from '../CardContainer';
import Title from '../Title';
import { LoadingButton } from '@mui/lab';
import { Stack } from '@mui/material';
import { getColor, getDefaultIcon, toSxArray } from './utils';
const StateCard = ({ title, description, primaryAction, secondaryAction, variant = 'primary', icon, slotProps, }) => {
    const defaultIcon = getDefaultIcon(variant);
    const color = getColor(variant);
    const { label: primaryLabel, ...primaryButtonProps } = primaryAction ?? {};
    const { label: secondaryLabel, ...secondaryButtonProps } = secondaryAction ?? {};
    return (_jsx(CardContainer, { fullWidth: true, ...slotProps?.card, children: _jsxs(Stack, { ...slotProps?.container, sx: [
                {
                    flexDirection: 'column',
                    gap: 2,
                    alignItems: 'center',
                },
                ...toSxArray(slotProps?.container?.sx),
            ], children: [_jsx(Avatar, { color: color, Icon: icon ?? defaultIcon, ...slotProps?.avatar }), _jsx(Title, { title: title, description: description, variant: "M", centered: true, ...slotProps?.title }), (primaryAction || secondaryAction) && (_jsxs(Stack, { ...slotProps?.actionsContainer, sx: [
                        { flexDirection: 'row', gap: 2 },
                        ...toSxArray(slotProps?.actionsContainer?.sx),
                    ], children: [secondaryAction && (_jsx(LoadingButton, { size: "small", ...secondaryButtonProps, children: secondaryLabel })), primaryAction && (_jsx(LoadingButton, { size: "small", variant: "outlined", ...primaryButtonProps, children: primaryLabel }))] }))] }) }));
};
export default StateCard;
