initial working version

This commit is contained in:
Hunter Thornsberry
2024-08-06 00:50:17 -04:00
parent 1c7c44a472
commit cd0fcbbf90
3 changed files with 52 additions and 39 deletions
@@ -3,11 +3,11 @@ import type {
GenericFormElementProps,
} from "@components/Form/DynamicForm.js";
import { Generator } from "@components/UI/Generator.js";
import { useState } from "react";
import { Controller, type FieldValues } from "react-hook-form";
export interface PasswordGeneratorProps<T> extends BaseFormBuilderProps<T> {
type: "passwordGenerator";
devicePSKBitCount: number;
}
export function PasswordGenerator<T extends FieldValues>({
@@ -20,11 +20,13 @@ export function PasswordGenerator<T extends FieldValues>({
control={control}
render={({ field: { value, onChange, ...rest } }) => (
<Generator
devicePSKBitCount={field.devicePSKBitCount}
changeEvent={onChange}
value={value}
variant={"success"}
textValue="Generate"
buttonText="Generate"
{...field.properties}
{...rest}
/>
{...rest} />
)}
/>
);