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);