feat: add playground

This commit is contained in:
Gabe
2025-10-02 21:59:31 +08:00
parent 389f0b6f82
commit 65e8fabe7d
14 changed files with 468 additions and 282 deletions

View File

@@ -0,0 +1,28 @@
import { useState } from "react";
import TranForm from "../Selection/TranForm";
import { DEFAULT_SETTING, DEFAULT_TRANBOX_SETTING } from "../../config";
import { useSetting } from "../../hooks/Setting";
export default function Playgound() {
const [text, setText] = useState("");
const { setting } = useSetting();
const { transApis, langDetector, tranboxSetting } =
setting || DEFAULT_SETTING;
const { apiSlugs, fromLang, toLang, toLang2, enDict } =
tranboxSetting || DEFAULT_TRANBOX_SETTING;
return (
<TranForm
text={text}
setText={setText}
apiSlugs={apiSlugs}
fromLang={fromLang}
toLang={toLang}
toLang2={toLang2}
transApis={transApis}
simpleStyle={false}
langDetector={langDetector}
enDict={enDict}
isPlaygound={true}
/>
);
}