This commit is contained in:
2024-04-21 14:42:52 +02:00
parent 4b69674ede
commit 8a25f53c99
10700 changed files with 55767 additions and 14201 deletions

View File

@ -0,0 +1,32 @@
import { useMemo } from 'react'
import { Tag } from '@chakra-ui/react'
import cx from 'classnames'
import parseEmailList from '@/helpers/parse-email-list'
export type EmailTokenizerProps = {
value: string
}
const EmailTokenizer = ({ value }: EmailTokenizerProps) => {
const emails = useMemo(() => parseEmailList(value), [value])
return (
<>
{emails.length > 0 ? (
<div className={cx('flex', 'flex-wrap', 'gap-0.5')}>
{emails.map((email, index) => (
<Tag
key={index}
size="md"
variant="solid"
className={cx('rounded-full')}
>
{email}
</Tag>
))}
</div>
) : null}
</>
)
}
export default EmailTokenizer