diff --git a/components/Container.tsx b/components/Container.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/components/InputForm.tsx b/components/InputForm.tsx index f491333..cc402c2 100644 --- a/components/InputForm.tsx +++ b/components/InputForm.tsx @@ -15,7 +15,8 @@ import { FormMessage, } from "@/components/ui/form" import { Input } from "@/components/ui/input" -import ScopeInput from './ScopeInput'; +import { readScopes, writeScopes, adminScopes } from "@/lib/utils" +import ScopeSection from "./ScopeSection" const formSchema = z.object({ instance: z.string().trim(), @@ -29,14 +30,13 @@ const InputForm = () => { const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { + instance:'https://', clientName: '', redirectUris: 'urn:ietf:wg:oauth:2.0:oob', }, }) function onSubmit(values: z.infer) { - // Do something with the form values. - // ✅ This will be type-safe and validated. console.log(values) } @@ -55,7 +55,6 @@ const InputForm = () => { - )} /> { /> ( Scopes - - + +
+ + + + + + +
diff --git a/components/ScopeInput.tsx b/components/ScopeSection.tsx similarity index 66% rename from components/ScopeInput.tsx rename to components/ScopeSection.tsx index d3174e1..0f987d3 100644 --- a/components/ScopeInput.tsx +++ b/components/ScopeSection.tsx @@ -1,46 +1,41 @@ "use client"; import { Checkbox } from "@/components/ui/checkbox"; -import { ReadScope, AdminScope, WriteScope } from "@/lib/types"; -import { readScopes, adminScopes, writeScopes } from "@/lib/utils"; -import { MethodType } from "@/lib/types"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; -import { ChevronsUpDown } from "lucide-react"; import { Button } from "@/components/ui/button"; +import { ChevronsUpDown } from "lucide-react"; + +import { ReadScope, AdminScope, WriteScope } from "@/lib/types"; +import { MethodType } from "@/lib/types"; +import { ControllerRenderProps } from "react-hook-form"; interface ScopeSectionProps { method: MethodType; scopes?: ReadScope[] | WriteScope[] | AdminScope[]; } -const ScopeSection: React.FC = ({ method, scopes }) => { +const ScopeSection: React.FC = ({ method, scopes}) => { + return ( - +
-
- +
+
-

- {method === "read" && "read all your account's data"} - {method === "write" && "modify all your account's data"} - {method === "admin" && "read all data on the server"} +

+ {method === "read" && "read your account's data"} + {method === "write" && "modify your account's data"} + {method === "admin" && "read data on the server"} {method === "follow" && "modify account relationships"} {method === "push" && "receive your push notifications"} {method === "crypto" && "use end-to-end encryption"} @@ -82,17 +77,4 @@ const ScopeSection: React.FC = ({ method, scopes }) => { ); }; -const ScopeInput = (props: any) => { - return ( -

- - - - - - -
- ); -}; - -export default ScopeInput; +export default ScopeSection;