import React, { forwardRef } from 'react';
import { makeStyles, Tooltip, IconButton, Chip, Typography } from '@material-ui/core';
import { FluentIcon } from '../../../utilities/iconLibrary/FluentIcon';
import PropTypes from 'prop-types';
const useStyles = makeStyles((theme) => ({
    root: {},
    actionHeader: {
        display: 'flex',
        flexDirection: 'row'
    },
    icon: {
        marginLeft: theme.spacing(1),
        color: (props) => props.background === 'transparent'
            ? theme.palette.secondary.main
            : theme.palette.primary.main
    },
    chipRoot: {
        background: (props) => props.background ? props.background : theme.palette.common.white
    },
    label: {
        overflow: 'hidden',
        whiteSpace: 'nowrap',
        textOverflow: 'ellipsis'
    }
}));
export const AmbientChipButton = forwardRef(function AmbientChipButton(props, ref) {
    const { tooltip, label, onClick, icon, iconClassName, className, labelClassName, otherProps, id = 'chip-button', udprecordid } = props;
    const classes = useStyles(props);
    return (React.createElement("div", { className: classes.root }, React.createElement(Tooltip, { title: tooltip }, React.createElement(Chip, Object.assign({ id: id, udprecordid: udprecordid, ref: ref, className: className !== null && className !== void 0 ? className : classes.chipRoot, label: React.createElement(Typography, { className: labelClassName !== null && labelClassName !== void 0 ? labelClassName : classes.label }, label), onClick: onClick, icon: icon && (React.createElement(FluentIcon, { className: iconClassName !== null && iconClassName !== void 0 ? iconClassName : classes.icon, component: icon })) }, otherProps)))));
});
AmbientChipButton.propTypes = {
    /**
     * Tooltip to display for button
     */
    tooltip: PropTypes.string.isRequired,
    /**
     * Accessiblity label for icon
     */
    label: PropTypes.string.isRequired,
    /**
     * event for button function
     */
    onClick: PropTypes.func,
    /**
     * icon to appear in button
     */
    icon: PropTypes.func.isRequired
};
//# sourceMappingURL=AmbientChipButton.js.map