Skip to content

Let's use AI to Earn!

feat(热门内容): 添加热门专题顶部标签选择

gaoSir819a5158c894
diff --git a/src/app/[lng]/hotContent/components/HotFeatures/hotFeatures.module.scss b/src/app/[lng]/hotContent/components/HotFeatures/hotFeatures.module.scss
new file mode 100644
index 00000000..d19160e0
--- /dev/null
+++ b/src/app/[lng]/hotContent/components/HotFeatures/hotFeatures.module.scss
@@ -0,0 +1,3 @@
+.hotFeatures {
+
+}
\ No newline at end of file
diff --git a/src/app/[lng]/hotContent/components/HotFeatures/index.tsx b/src/app/[lng]/hotContent/components/HotFeatures/index.tsx
index 91132ba6..423ededd 100644
--- a/src/app/[lng]/hotContent/components/HotFeatures/index.tsx
+++ b/src/app/[lng]/hotContent/components/HotFeatures/index.tsx
@@ -1,26 +1,52 @@
-import {
- ForwardedRef,
- forwardRef,
- memo
-} from "react";
+import { ForwardedRef, forwardRef, memo, useRef, useState } from "react";
+import styles from "./hotFeatures.module.scss";
+import HotContentLabel from "@/app/[lng]/hotContent/components/HotContentLabel";
-export interface IHotFeaturesRef {
-}
+export interface IHotFeaturesRef {}
-export interface IHotFeaturesProps {
-}
+export interface IHotFeaturesProps {}
const HotFeatures = memo(
- forwardRef(
- (
- {}: IHotFeaturesProps,
- ref: ForwardedRef<IHotFeaturesRef>
- ) => {
- return (
- <div></div>
- );
- }
- )
+ forwardRef(({}: IHotFeaturesProps, ref: ForwardedRef<IHotFeaturesRef>) => {
+ const allDates = useRef(["近3天", "近7天", "近15天", "近30天"]);
+ // 当前选择的日期范围
+ const [currDate, setCurrDate] = useState("");
+ // 当前选择的平台
+ const [currPlat, setCurrPlat] = useState("");
+ // 当前选择的分类
+ const [labelValue, setLabelValue] = useState("");
+
+ return (
+ <div className={styles.hotFeatures}>
+ <HotContentLabel
+ labels={[
+ "AI教程",
+ "AI绘画",
+ "AI热点",
+ "AI创作",
+ "AI大模型",
+ "Prompt",
+ ]}
+ value={labelValue}
+ onChange={(value) => {
+ if (value === labelValue) {
+ setLabelValue("");
+ } else {
+ setLabelValue(value);
+ }
+ }}
+ />
+
+ <HotContentLabel
+ labels={allDates.current}
+ value={currDate}
+ onChange={(value) => {
+ setCurrDate(value);
+ }}
+ />
+ </div>
+ );
+ }),
);
export default HotFeatures;