diff --git a/src/components/ui/BackendCard.tsx b/src/components/ui/BackendCard.tsx new file mode 100644 index 0000000..7b80dd2 --- /dev/null +++ b/src/components/ui/BackendCard.tsx @@ -0,0 +1,28 @@ +import type { ButtonHTMLAttributes } from 'react'; + +interface BackendCardProps extends Omit, 'onClick'> { + name: string; + description: string; + selected?: boolean; + onClick: () => void; +} + +export function BackendCard({ name, description, selected = false, onClick, ...rest }: BackendCardProps) { + return ( + + ); +} diff --git a/src/components/ui/PasswordField.tsx b/src/components/ui/PasswordField.tsx new file mode 100644 index 0000000..3befc7f --- /dev/null +++ b/src/components/ui/PasswordField.tsx @@ -0,0 +1,44 @@ +import { useState } from 'react'; +import type { FieldError, UseFormRegisterReturn } from 'react-hook-form'; + +interface PasswordFieldProps { + id: string; + label: string; + error?: FieldError; + registration: UseFormRegisterReturn; + placeholder?: string; + helpText?: string; +} + +export function PasswordField({ id, label, error, registration, placeholder, helpText }: PasswordFieldProps) { + const [show, setShow] = useState(false); + return ( +
+ +
+ + +
+ {helpText && !error &&

{helpText}

} + {error &&

{error.message}

} +
+ ); +}