import type { ButtonHTMLAttributes, PropsWithChildren, ReactNode } from 'react'
import type { LucideIcon } from 'lucide-react'
import type {goodsType} from './business.type.ts'
export type RecordButtonType = 'order' | 'record'
export type HostContextMessage = {
type: 'IFRAME_CONTEXT'
payload?: {
token?: string
language?: string
username?: string
}
}
export type ButtonVariant = 'orange' | 'gray'
export type ButtonProps = PropsWithChildren> & {
variant?: ButtonVariant
}
export type ModalProps = {
open: boolean
title?: ReactNode
children: ReactNode
footer?: ReactNode
onClose?: () => void
closeOnOverlayClick?: boolean
className?: string
bodyClassName?: string
}
export type PageLayoutProps = {
children: ReactNode
contentClassName?: string
}
export type TableColumn> = {
label: string
key: keyof T
render?: (value: T[keyof T], record: T, index: number) => ReactNode
}
export type QuickNavCardProps = {
icon: LucideIcon
label: string
to: string
}
export type ProductItem = {
id: string
title: string
subtitle: string
score: string
ctaLabel: string
imageClassName?: string
imageUrl?: string
}
export type ProductCategory = {
id: goodsType
name: string
items: ProductItem[]
}
export type SelectedProductState = {
categoryId: ProductCategory['id']
product: ProductItem
}
export type AddressOption = {
id: string
name: string
phone: string
address: string
isDefault?: boolean
}
export type ModalMode = 'select-address' | 'add-address'
export type AddAddressForm = {
name: string
phone: string
detailedAddress: string
isDefault: boolean
}
export type AccountTableRow = {
name: string
phone: string
address: string
code: string
action: string
setting: string
}
export type PointsRecordTone = 'positive' | 'negative'
export type OrderRecord = {
id: string
orderNumber?: string
date: string
time: string
category: string
title: string
trackingNumber?: string
status: string
points: string
}
export type PointsRecord = {
id: string
title: string
date: string
time: string
amount: string
tone: PointsRecordTone
}
export type TabButtonProps = {
active: boolean
label: string
icon: LucideIcon
onClick: () => void
}
export type OrderCardProps = {
record: OrderRecord
onOpenDetails: (record: OrderRecord) => void
}
export type PointsCardProps = {
record: PointsRecord
}