+ );
+}
diff --git a/docs/src/app/[locale]/mykey/page.tsx b/docs/src/app/[locale]/mykey/page.tsx
new file mode 100644
index 0000000..0b4ae89
--- /dev/null
+++ b/docs/src/app/[locale]/mykey/page.tsx
@@ -0,0 +1,66 @@
+import { translateText } from "azure-translator-code";
+
+import MyKeyForm from "./Form";
+
+export default async function MyKeyPage() {
+ async function translateLocal(prevState: any, formData: FormData) {
+ "use server";
+ const data = {
+ secretKey: formData.get("ownkey") as string,
+ endpoint: formData.get("ownendpoint") as string,
+ location: formData.get("ownlocation") as string,
+ text: formData.get("owntexttotranslate") as string,
+ fromLang: formData.get("ownfromlang") as string,
+ toLang: formData.get("owntolang") as string,
+ };
+
+ try {
+ if (
+ !data.secretKey.trim() ||
+ !data.endpoint.trim() ||
+ !data.location.trim() ||
+ !data.text.trim() ||
+ !data.fromLang.trim() ||
+ !data.toLang.trim()
+ ) {
+ return {
+ message: "Please fill in all fields",
+ };
+ }
+
+ const response = await translateText(
+ data.text,
+ data.fromLang,
+ [data.toLang],
+ data.endpoint,
+ data.secretKey,
+ data.location,
+ );
+
+ return {
+ message: response[0].translations[0].text as unknown as string,
+ };
+ } catch {
+ return {
+ message: "An error occurred, check your secret key and try again",
+ };
+ }
+ }
+ return (
+
+
+
+ Test your Secret Key
+
+
+ Enter your secret key, endpoint, location, text to translate, and
+ translation languages to test your key. !!! IMPORTANT !!! We do not
+ store your secret key, endpoint, location, or any other information
+ you enter here. This is a test page to check if your key is working
+ correctly.
+