import React from 'react';
import { Chip, makeStyles } from '@material-ui/core';
import clsx from 'clsx';
const useStyles = makeStyles((theme) => ({
    smallChip: {
        height: theme.spacing(2.5),
        fontSize: '0.7rem',
        '& .MuiChip-label': {
            paddingLeft: theme.spacing(0.75),
            paddingRight: theme.spacing(0.75)
        }
    },
    actionable: {
        cursor: 'pointer'
    },
    success: {
        backgroundColor: theme.palette.success.main,
        color: '#FFF',
        '&.MuiChip-outlined': {
            color: theme.palette.success.main,
            borderColor: theme.palette.success.main,
            backgroundColor: 'transparent'
        }
    },
    warning: {
        backgroundColor: theme.palette.warning.main,
        color: '#FFF',
        '&.MuiChip-outlined': {
            color: theme.palette.warning.main,
            borderColor: theme.palette.warning.main,
            backgroundColor: 'transparent'
        }
    },
    error: {
        backgroundColor: theme.palette.error.main,
        color: '#FFF',
        '&.MuiChip-outlined': {
            color: theme.palette.error.main,
            borderColor: theme.palette.error.main,
            backgroundColor: 'transparent'
        }
    },
    info: {
        backgroundColor: theme.palette.info.main,
        color: theme.palette.getContrastText(theme.palette.info.main),
        '&.MuiChip-outlined': {
            color: theme.palette.info.main,
            borderColor: theme.palette.info.main,
            backgroundColor: 'transparent'
        }
    }
}));
export const StatusChip = ({ status, label, useSmallChip = false, isActionable = false, icon, variant = 'default', onClick, }) => {
    const classes = useStyles();
    const chipClass = clsx({
        [classes.smallChip]: useSmallChip,
        [classes.actionable]: isActionable,
        [classes.success]: status === 'success',
        [classes.warning]: status === 'warning',
        [classes.error]: status === 'error',
        [classes.info]: status === 'info'
    });
    return (React.createElement(Chip, { className: chipClass, label: label, size: "small", icon: icon || null, variant: variant, onClick: isActionable ? onClick : null }));
};
//# sourceMappingURL=StatusChip.js.map