initial working version
This commit is contained in:
@@ -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} />
|
||||
)}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user