create useform hook
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Image, { StaticImageData } from 'next/image'
|
||||
import { StaticImageData } from 'next/image'
|
||||
|
||||
export interface TextInputProps {
|
||||
value: string
|
||||
@@ -16,7 +16,7 @@ export interface ButtonProps {
|
||||
onClick?: () => void
|
||||
className?: string
|
||||
text?: string
|
||||
type?: 'button'
|
||||
type?: 'button' | 'submit' | 'reset'
|
||||
}
|
||||
|
||||
export interface SearchCardProps {
|
||||
@@ -66,3 +66,46 @@ export interface NewsItem {
|
||||
export interface NewsProps {
|
||||
news: NewsItem[]
|
||||
}
|
||||
|
||||
export interface ValidationRules {
|
||||
required?: boolean
|
||||
minLength?: number
|
||||
pattern?: RegExp
|
||||
}
|
||||
|
||||
export interface ValidationErrors {
|
||||
[key: string]: string
|
||||
}
|
||||
|
||||
export type ToastProps = {
|
||||
type: 'error' | 'success' | 'loading'
|
||||
message: string
|
||||
action?: {
|
||||
text: string
|
||||
onClick: () => void
|
||||
}
|
||||
duration?: number
|
||||
}
|
||||
|
||||
export type MembershipPlans = {
|
||||
plan: 'lite' | 'standart' | 'premium'
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id?: number | undefined | string
|
||||
uuid?: string
|
||||
name: string
|
||||
surname: string
|
||||
image?: string
|
||||
phone_number?: string
|
||||
email: string
|
||||
country?: string
|
||||
city?: string
|
||||
plan: MembershipPlans
|
||||
account_type?: string // user или manager
|
||||
}
|
||||
|
||||
export interface UserState {
|
||||
isAuthenticated: boolean
|
||||
user: User | null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user