From 48d07b5f8f5a81441cfad744c1021d10f9350bab Mon Sep 17 00:00:00 2001 From: ymk Date: Sat, 2 Aug 2025 17:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/[locale]/page.tsx | 2 +- src/components/SimpleEditor.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 7549258..12d087c 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -41,7 +41,7 @@ export default function HomePage() { {t("toolTitle")} - + diff --git a/src/components/SimpleEditor.tsx b/src/components/SimpleEditor.tsx index c1daa78..cb5b3e4 100644 --- a/src/components/SimpleEditor.tsx +++ b/src/components/SimpleEditor.tsx @@ -14,20 +14,20 @@ import { useRouter } from "@/i18n/navigation"; * 简易工具 * @returns */ -export default function Page() { +export default function SimpleEditor({ textProp, backgroundProp }: { textProp: TextProp | undefined, backgroundProp: BackgroundProp | undefined }) { const t = useTranslations("TextEditor"); const tIndex = useTranslations("HomePage"); const router = useRouter(); - let backgroundProp = { + backgroundProp = { type: "color", color: "#c4b1b1", image: null, } satisfies BackgroundProp; - let textProp = TextProp.default(t("defaultText")); + textProp = textProp || TextProp.default(t("defaultText")); const [background, setBackground] = useState(backgroundProp);