From 1dcaaf2c1193fa83f592b69355397a37c62d6633 Mon Sep 17 00:00:00 2001 From: moux1024 <403053463@qq.com> Date: Thu, 25 Sep 2025 20:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E6=94=B916:9?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChatInputBox/AspectRatioSelector.tsx | 84 +++++++++---------- components/ChatInputBox/ChatInputBox.tsx | 3 +- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/components/ChatInputBox/AspectRatioSelector.tsx b/components/ChatInputBox/AspectRatioSelector.tsx index 97ed5f5..95d4804 100644 --- a/components/ChatInputBox/AspectRatioSelector.tsx +++ b/components/ChatInputBox/AspectRatioSelector.tsx @@ -1,8 +1,6 @@ "use client"; -import { Dropdown } from "antd"; import { RectangleHorizontal, RectangleVertical } from "lucide-react"; -import { AspectRatioOptions } from "./types"; export type AspectRatioValue = | "VIDEO_ASPECT_RATIO_LANDSCAPE" @@ -22,13 +20,13 @@ interface AspectRatioSelectorProps { } /** - * A reusable aspect ratio selector (landscape/portrait) using Antd Dropdown. - * Shows an icon and label, and calls onChange when a new ratio is chosen. + * Aspect ratio selector using Antd Radio.Group with two options: landscape and portrait. + * Uses icons as button content and triggers onChange when selection changes. * @param {AspectRatioValue} value - current selected value * @param {(v: AspectRatioValue) => void} onChange - change handler - * @param {string} [className] - optional className for trigger button - * @param {string} [placement] - Dropdown placement, default is top - * @param {string} [dataAlt] - data-alt attribute for the trigger + * @param {string} [className] - optional className for wrapper + * @param {string} [placement] - kept for backward compatibility (unused) + * @param {string} [dataAlt] - data-alt attribute for the wrapper * @returns {JSX.Element} */ export const AspectRatioSelector = ({ @@ -39,45 +37,47 @@ export const AspectRatioSelector = ({ dataAlt = "config-aspect-ratio", }: AspectRatioSelectorProps) => { return ( - ({ - key: option.value, - label: ( -
- {option.value === "VIDEO_ASPECT_RATIO_LANDSCAPE" ? ( - - ) : ( - - )} - {option.label} -
- ), - })), - onClick: ({ key }) => onChange(key as AspectRatioValue), - }} - trigger={["click"]} - placement={placement} +
- + +
); }; diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index 04e219e..dd530cd 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -523,11 +523,12 @@ export function ChatInputBox({ noData }: { noData: boolean }) { placement="top" >