import type { Dispatch, SetStateAction } from 'react' export enum ValidatedStatus { Success = 'success', Error = 'error', Exceed = 'exceed', } export type ValidatedStatusState = { status?: ValidatedStatus message?: string } export type Status = 'add' | 'fail' | 'success' export type ValidateValue = Record export type ValidateCallback = { before: (v?: ValidateValue) => boolean | undefined run?: (v?: ValidateValue) => Promise } export type Form = { key: string title: string placeholder: string value?: string validate?: ValidateCallback handleFocus?: (v: ValidateValue, dispatch: Dispatch>) => void } export type KeyFrom = { text: string link: string } export type KeyValidatorProps = { type: string title: React.ReactNode status: Status forms: Form[] keyFrom: KeyFrom }