优化编辑资源标签样式

This commit is contained in:
2025-05-12 22:16:34 +08:00
parent 5159fa3606
commit ee4feb57c5
2 changed files with 2 additions and 2 deletions

View File

@@ -151,7 +151,7 @@ export default function ResourceEdit({ children, id, onRefresh }: ResourceEditPr
<Label htmlFor="admin-web-resource-add-tags" className="text-right">
</Label>
<div className="flex items-center gap-2">
<div className="col-span-3 w-full flex flex-wrap items-center gap-2 gap-y-1">
{
resource.tags.map((tag, index) => (
<ResourceBadge tag={tag} key={index} editMode={true} onClose={name => mutate({ ...resource, tags: resource.tags.filter(tag => tag.name !== name) }, false)} />

View File

@@ -23,7 +23,7 @@ export function ResourceBadge({ tag, editMode, onClose, ...props }: ResourceBadg
}}
{...props}
>
<span>{tag.name}</span>
<span className="text-nowrap">{tag.name}</span>
{
editMode && (
<span onClick={() => onClose?.(tag.name)}><X className="w-3 h-3 text-zinc-800 cursor-pointer" /></span>