diff --git a/components/admin/upload/FileUpload.tsx b/components/admin/upload/FileUpload.tsx
index a5b463e..f84abdf 100644
--- a/components/admin/upload/FileUpload.tsx
+++ b/components/admin/upload/FileUpload.tsx
@@ -2,7 +2,7 @@
import React, { useState } from 'react'
import type { UploadProps } from 'antd'
-import { Upload, ConfigProvider, Select as AntdSelect } from 'antd'
+import { Upload, ConfigProvider } from 'antd'
import { toast } from 'sonner'
import useSWR from 'swr'
import { fetcher } from '~/lib/utils/fetcher'
@@ -25,6 +25,7 @@ import {
import { CircleHelpIcon } from '~/components/icons/circle-help'
import { ImagePlus } from 'lucide-react'
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '~/components/ui/sheet.tsx'
+import { Tag, TagInput } from 'emblor'
export default function FileUpload() {
const [alistStorage, setAlistStorage] = useState([])
@@ -46,6 +47,7 @@ export default function FileUpload() {
const [imageLabels, setImageLabels] = useState([] as string[])
const [mode, setMode] = useState('singleton')
const [customUpload, setCustomUpload] = useState(false)
+ const [activeTagIndex, setActiveTagIndex] = useState
(null);
const { setUploadHelp } = useButtonStore(
(state) => state,
)
@@ -873,13 +875,24 @@ export default function FileUpload() {
className="mt-1 w-full border-none p-0 focus:border-transparent focus:outline-none focus:ring-0 sm:text-sm"
/>
- ({ id: Math.floor(Math.random() * 1000), text: label }))}
+ setTags={(newTags: any) => {
+ setImageLabels(newTags?.map((label: Tag) => label.text))
+ }}
placeholder="请输入图片索引标签,如:猫猫,不要输入特殊字符。"
- onChange={(value: any) => setImageLabels(value)}
- options={[]}
+ styleClasses={{
+ inlineTagsContainer:
+ "border-input rounded-lg bg-background shadow-sm shadow-black/5 transition-shadow focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/20 p-1 gap-1",
+ input: "w-full min-w-[80px] focus-visible:outline-none shadow-none px-2 h-7",
+ tag: {
+ body: "h-7 relative bg-background border border-input hover:bg-background rounded-md font-medium text-xs ps-2 pe-7",
+ closeButton:
+ "absolute -inset-y-px -end-px p-0 rounded-e-lg flex size-7 transition-colors outline-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70 text-muted-foreground/80 hover:text-foreground",
+ },
+ }}
+ activeTagIndex={activeTagIndex}
+ setActiveTagIndex={setActiveTagIndex}
/>
>
@@ -1093,13 +1106,24 @@ export default function FileUpload() {
className="mt-1 w-full border-none p-0 focus:border-transparent focus:outline-none focus:ring-0 sm:text-sm"
/>
-