UNPKG

@wulperstudio/cms

Version:
47 lines 1.69 kB
/* eslint-disable react/no-array-index-key */ /* eslint-disable react/prop-types */ import React from 'react'; import { Avatar, Stack } from '@mui/material'; import { Icon } from '@iconify/react'; import { Chip } from '../Chip'; import { Box, Label } from './styled'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; var ChipOutput = function ChipOutput(props) { return /*#__PURE__*/_jsxs(Box, { showBorder: props.showBorder, backgroundColor: props.backgroundColor, showBoxShadow: props.showBoxShadow, showDivider: props.showDivider, children: [/*#__PURE__*/_jsx(Label, { children: props.label }), /*#__PURE__*/_jsx(Stack, { direction: "row", flexWrap: "wrap", gap: "5px", children: props.listChip && props.listChip.map(function (item, i) { return /*#__PURE__*/_jsx(Chip, { label: item.label, chipProps: { avatar: props.isWithAvatar ? /*#__PURE__*/_jsx(Avatar, { alt: item.label, src: item.srcAvatar }) : undefined, sx: { fontSize: '14px', color: props.textColor || '#000', backgroundColor: props.backgroundColorChip || '#00000014' }, deleteIcon: props.deleteIconChip ? /*#__PURE__*/_jsx(Icon, { icon: "akar-icons:circle-x-fill", color: props.textColor || '#000' }) : undefined, onDelete: props.deleteIconChip ? function () { return props.onDeleteChip && props.onDeleteChip(item.label); } : undefined } }, i); }) })] }); }; export default ChipOutput;