diff --git a/src/app/[lang]/components/search.tsx b/src/app/[lang]/components/search.tsx index cfe9bdaf..630e8f8c 100644 --- a/src/app/[lang]/components/search.tsx +++ b/src/app/[lang]/components/search.tsx @@ -16,8 +16,9 @@ import { api } from "~/trpc/react"; import { useRouter } from "next/navigation"; import { CommandLoading } from "cmdk"; import { type Locale, type Dictionary } from "~/dictionaries"; +import { Search } from "lucide-react"; -export default function CommandDemo({ +export default function SearchDialog({ dict, lang, }: { @@ -52,18 +53,29 @@ export default function CommandDemo({ return ( - + <> + + + + - + - + {dict.search.empty} {isLoading && } @@ -91,26 +103,31 @@ export default function CommandDemo({ }} > { - return `${e}`; - }), - }} - /> - | - { - e.stopPropagation(); - router.push(`/${lang}/author/${item.author.id}`); - setOpen(false); - }} - className="cursor-pointer hover:underline" - dangerouslySetInnerHTML={{ - __html: item.author.name.replace(value, (e) => { - return `${e}`; - }), + __html: item.title + .substring(0, 15) + .replace(value, (e) => { + return `${e}`; + }), }} /> + + | + { + e.stopPropagation(); + router.push(`/${lang}/author/${item.author.id}`); + setOpen(false); + }} + className="cursor-pointer hover:underline" + dangerouslySetInnerHTML={{ + __html: item.author.name.replace(value, (e) => { + return `${e}`; + }), + }} + /> + {value && content && ( diff --git a/src/app/[lang]/layout.tsx b/src/app/[lang]/layout.tsx index 0c70010c..ec1d894b 100644 --- a/src/app/[lang]/layout.tsx +++ b/src/app/[lang]/layout.tsx @@ -91,7 +91,7 @@ export default async function Layout({ id="header_main" >
-
+
diff --git a/src/app/[lang]/poem/[id]/page.tsx b/src/app/[lang]/poem/[id]/page.tsx index 472e39c5..453d7cc4 100644 --- a/src/app/[lang]/poem/[id]/page.tsx +++ b/src/app/[lang]/poem/[id]/page.tsx @@ -178,14 +178,14 @@ export default async function Page({ params, searchParams }: Props) { {/* 标签 */}
{poem.tags.length > 0 && ( -
+
{poem.tags.map((item) => { return (