remove item

This commit is contained in:
2025-12-11 12:16:20 -03:00
parent f728b23d3a
commit 3fb8488074

View File

@@ -1,5 +1,5 @@
import { useRequest, useToggle } from 'ahooks' import { useRequest, useToggle } from 'ahooks'
import { CheckIcon, UserIcon } from 'lucide-react' import { CheckIcon, UserIcon, XIcon } from 'lucide-react'
import { formatCPF } from '@brazilian-utils/brazilian-utils' import { formatCPF } from '@brazilian-utils/brazilian-utils'
import { Avatar, AvatarFallback } from '@repo/ui/components/ui/avatar' import { Avatar, AvatarFallback } from '@repo/ui/components/ui/avatar'
@@ -24,6 +24,7 @@ import {
CommandList CommandList
} from '@repo/ui/components/ui/command' } from '@repo/ui/components/ui/command'
import { Spinner } from '@repo/ui/components/ui/spinner' import { Spinner } from '@repo/ui/components/ui/spinner'
import { Button } from '@repo/ui/components/ui/button'
interface AsyncComboboxProps { interface AsyncComboboxProps {
value: any value: any
@@ -66,6 +67,23 @@ export function AsyncCombobox({
<UserIcon /> <UserIcon />
</InputGroupAddon> </InputGroupAddon>
{value && (
<InputGroupAddon align="inline-end" className="mr-0">
<Button
variant="link"
size="icon-sm"
className="cursor-pointer text-black dark:text-white"
onClick={(e) => {
e.preventDefault()
onChange?.(undefined)
set(false)
}}
>
<XIcon />
</Button>
</InputGroupAddon>
)}
{loading && ( {loading && (
<InputGroupAddon align="inline-end"> <InputGroupAddon align="inline-end">
<Spinner /> <Spinner />