diff --git a/components/InputForm.tsx b/components/InputForm.tsx index aeac7a7..9263474 100644 --- a/components/InputForm.tsx +++ b/components/InputForm.tsx @@ -69,7 +69,7 @@ const scopesInfo: ScopeInfo[] = [ }, { method: "crypto", - label: "Crypto", + label: "Crypto", description: "use end-to-end encryption", }, ]; @@ -89,6 +89,7 @@ const InputForm = () => { instance: "https://", clientName: "", redirectUris: "", + scopes:[] }, }); diff --git a/components/ScopeItem.tsx b/components/ScopeItem.tsx index 7d91d49..4237201 100644 --- a/components/ScopeItem.tsx +++ b/components/ScopeItem.tsx @@ -1,4 +1,4 @@ -'use client' +"use client"; import { MethodType } from "./InputForm"; import { Checkbox } from "@/components/ui/checkbox"; @@ -6,15 +6,28 @@ import { Checkbox } from "@/components/ui/checkbox"; interface ScopeCheckboxProps { scope: string; method: MethodType; + field: any; } -const ScopeItem: React.FC = ({ scope, method }) => { +const ScopeItem: React.FC = ({ scope, method, field }) => { + + return (
- + { + return checked + ? field.onChange([...field.value, scope]) + : field.onChange( + field.value?.filter((value: string) => value !== scope) + ); + }} + />