import DeleteIcon from '@mui/icons-material/Delete' import DoneIcon from '@mui/icons-material/Done' import TagFacesIcon from '@mui/icons-material/TagFaces' import Paper from '@mui/material/Paper' import Stack from '@mui/material/Stack' import { styled } from '@mui/material/styles' import type { ComponentMeta, ComponentStory } from '@storybook/react' import React from 'react' import Chip from './Chip' export default { title: 'Components/Chip', component: Chip, } as ComponentMeta export const Default: ComponentStory = (props) => ( ) export const BasicChip = () => ( ) export function ColorChips() { return ( ) } export const Clickable = () => { const handleClick = () => { alert('You clicked the Chip.') } return ( {/* @ts-ignore */} {/* @ts-ignore */} ) } export function Deletable() { const handleDelete = () => { alert('You clicked the delete icon.') } return ( {/* @ts-ignore */} {/* @ts-ignore */} ) } export function ClickableAndDeletable() { const handleClick = () => { console.info('You clicked the Chip.') } const handleDelete = () => { console.info('You clicked the delete icon.') } return ( ) } export function ClickableLink() { return ( {/* @ts-ignore TS2322: Type '{ label: string; component: string; href: string; clickable: true; }' is not assignable to type 'IntrinsicAttributes & { avatar?: ReactElement>; children?: null; classes?: Partial<...>; ... 9 more ...; variant?: "outlined" | "filled"; } & CommonProps & Omit<...> & { ...; }'. */} >; children?: null; classes?: Partial<...>; ... 9 more ...; variant?: "outlined" | "filled"; } & CommonProps & Omit<...> & { ...; }'. */ component="a" href="#basic-chip" variant="outlined" clickable /> ) } export function CustomDeleteIcon() { const handleClick = () => { console.info('You clicked the Chip.') } const handleDelete = () => { console.info('You clicked the delete icon.') } return ( } /> } variant="outlined" /> ) } export function SizesChips() { return ( ) } const ListItem = styled('li')(({ theme }) => ({ margin: theme.spacing(0.5), })) export function ChipsArray() { const [chipData, setChipData] = React.useState([ { key: 0, label: 'Angular' }, { key: 1, label: 'jQuery' }, { key: 2, label: 'Polymer' }, { key: 3, label: 'React' }, { key: 4, label: 'Vue.js' }, ]) const handleDelete = (chipToDelete: { key: any; label?: string }) => () => { setChipData((chips) => chips.filter((chip) => chip.key !== chipToDelete.key) ) } return ( {chipData.map((data) => { let icon if (data.label === 'React') { icon = } return ( ) })} ) }