From 665d12a828fde4635c0193f411a74b979ce23d50 Mon Sep 17 00:00:00 2001 From: LandaMm Date: Sat, 31 May 2025 16:15:22 +0200 Subject: [PATCH] feat: create api service page --- web/src/pages/ApiServices/Create/index.tsx | 172 +++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 web/src/pages/ApiServices/Create/index.tsx diff --git a/web/src/pages/ApiServices/Create/index.tsx b/web/src/pages/ApiServices/Create/index.tsx new file mode 100644 index 0000000..9ac8f7e --- /dev/null +++ b/web/src/pages/ApiServices/Create/index.tsx @@ -0,0 +1,172 @@ +import Breadcrumbs from "@/components/ui/breadcrumbs"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import type { FC } from "react"; +import { useForm } from "react-hook-form"; +import { Link } from "react-router"; + +interface FormData { + name: string; + description: string; + redirectUris: string; + scopes: string; + grantTypes: string; + enabled: boolean; +} + +const ApiServiceCreatePage: FC = () => { + const { + register, + handleSubmit, + formState: { errors }, + } = useForm({ + defaultValues: { + enabled: true, + scopes: "openid", + }, + }); + + const onSubmit = (data: FormData) => { + console.log("Form submitted:", data); + // handle create logic here (e.g. API call) + }; + + return ( +
+ +
+ {/* Service Information */} +
+
+

+ Service Information +

+
+
+
+

Name

+ + {errors.name && ( + + {errors.name.message} + + )} +
+ +
+

+ Description +

+ + {errors.description && ( + + {errors.description.message} + + )} +
+
+
+ + {/* OpenID Connect */} +
+
+

OpenID Connect

+
+
+
+

+ Redirect URIs +

+ + {errors.redirectUris && ( + + {errors.redirectUris.message} + + )} +
+ +
+

Scopes

+ + {errors.scopes && ( + + {errors.scopes.message} + + )} +
+ +
+

+ Grant Types +

+ +
+
+
+ + {/* Final Section */} +
+
+

+ Final Customization & Submit +

+
+
+ + +
+ + + + +
+
+
+
+
+ ); +}; + +export default ApiServiceCreatePage;