Skip to content

Commit

Permalink
chore: handle UI when no stop word
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Nov 25, 2024
1 parent 5980bc0 commit 4ce8aa4
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions web/containers/TagInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,25 @@ const TagInput = ({
}
}}
/>
<div className="mt-2 flex min-h-[2.5rem] flex-wrap items-center gap-2 overflow-y-auto">
{value.map((item, idx) => (
<Badge key={idx} theme="secondary">
{item}
<button
type="button"
className="ml-1.5 w-3 bg-transparent"
onClick={() => {
onValueChanged &&
onValueChanged(value.filter((i) => i !== item))
}}
>
<XIcon className="w-3" />
</button>
</Badge>
))}
</div>
{value.length > 0 && (
<div className="mt-2 flex min-h-[2.5rem] flex-wrap items-center gap-2 overflow-y-auto">
{value.map((item, idx) => (
<Badge key={idx} theme="secondary">
{item}
<button
type="button"
className="ml-1.5 w-3 bg-transparent"
onClick={() => {
onValueChanged &&
onValueChanged(value.filter((i) => i !== item))
}}
>
<XIcon className="w-3" />
</button>
</Badge>
))}
</div>
)}
</div>
)
}
Expand Down

0 comments on commit 4ce8aa4

Please sign in to comment.