react-garden
Version:
React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.
34 lines (27 loc) • 799 B
JavaScript
// ** MUI Imports
import MuiChip from '@mui/material/Chip'
// ** Hooks Imports
import useBgColor from '~/@core/hooks/useBgColor'
const Chip = props => {
// ** Props
const { sx, skin, color } = props
// ** Hook
const bgColors = useBgColor()
const colors = {
primary: { ...bgColors.primaryLight },
secondary: { ...bgColors.secondaryLight },
success: { ...bgColors.successLight },
error: { ...bgColors.errorLight },
warning: { ...bgColors.warningLight },
info: { ...bgColors.infoLight }
}
return (
<MuiChip
{...props}
variant='filled'
{...(skin === 'light' && { className: 'MuiChip-light' })}
sx={skin === 'light' && color ? Object.assign(colors[color], sx) : sx}
/>
)
}
export default Chip