diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx
index dd5d0d1..c7a847a 100644
--- a/app/(main)/page.tsx
+++ b/app/(main)/page.tsx
@@ -2,7 +2,7 @@ import SiderNav from "../_ui/SiderNav";
import Search from "../_ui/Search";
import LinkListBox from "../_ui/LinkListBox";
import { getLinkTypeList } from "../_lib/data/linkType";
-import { getLinkList, getLinkListAll } from "../_lib/data/link";
+import { getLinkList } from "../_lib/data/link";
import Footer from "../_ui/footer";
export default async function Page() {
diff --git a/app/_lib/data/link.ts b/app/_lib/data/link.ts
index aafedd4..23b7142 100644
--- a/app/_lib/data/link.ts
+++ b/app/_lib/data/link.ts
@@ -14,6 +14,7 @@ export type Link = {
logoLink: string;
isHot?: boolean;
addTime: number;
+ subLinkType?: string[];
}
diff --git a/app/_lib/data/linkType.ts b/app/_lib/data/linkType.ts
index 3b9ddf7..91d44aa 100644
--- a/app/_lib/data/linkType.ts
+++ b/app/_lib/data/linkType.ts
@@ -11,7 +11,7 @@ export type LinkType = {
_id: string;
href?: string;
priority?: number;
- subLinkType?: string[];
+ subCategory?: string[];
location?: string;
}
diff --git a/app/_ui/LinkListBox.tsx b/app/_ui/LinkListBox.tsx
index 1ac4a1f..f49f597 100644
--- a/app/_ui/LinkListBox.tsx
+++ b/app/_ui/LinkListBox.tsx
@@ -2,15 +2,16 @@
import Link from "next/link";
import { LinkType } from "../_lib/data/linkType";
import { Link as _Link } from "../_lib/data/link";
-import { useEffect, useMemo } from "react";
+import { useEffect, useMemo, useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowRight, faClock, faFire, faRightFromBracket, faRightLong, faTimeline, faTimesCircle, faTimesRectangle, faVolumeTimes } from "@fortawesome/free-solid-svg-icons";
import { useAtom } from "jotai";
import { linkTypeAtom } from "../_lib/atom";
import Image from "next/image";
+import clsx from "clsx";
const PICTURE_PREFIX = 'https://newuitab.oss-cn-hangzhou.aliyuncs.com/ai_upload/downloads/'
export const LinkBlock = ({ val }: { val: _Link }) => {
- return
@@ -19,10 +20,25 @@ export const LinkBlock = ({ val }: { val: _Link }) => {
}
+
export default function LinkListBox({ linkTypeList, linkList, showHot, showRecent }: { linkTypeList: LinkType[]; linkList: _Link[]; showHot: boolean; showRecent: boolean }) {
const hotList = useMemo(() => linkList.filter((val, index) => val.isHot && index < 12), [linkList])
const recentList = useMemo(() => linkList.map(val => val).sort((a, b) => b.addTime - a.addTime).filter((_, idx) => idx < 12), [linkList])
const [currentId] = useAtom(linkTypeAtom)
+ const [selectSubType, setSelectSubType] = useState