36 lines
780 B
TypeScript
36 lines
780 B
TypeScript
import type { IconProps } from "@/types/components/icon"
|
|
|
|
interface BaseCardProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
Icon?: (props: IconProps) => JSX.Element
|
|
declined?: boolean
|
|
iconHeight?: number
|
|
iconWidth?: number
|
|
name?: string
|
|
saving?: boolean
|
|
subtitle?: string
|
|
title: string
|
|
type: "checkbox" | "radio"
|
|
value?: string
|
|
}
|
|
|
|
interface ListCardProps extends BaseCardProps {
|
|
list: {
|
|
title: string
|
|
}[]
|
|
text?: never
|
|
}
|
|
|
|
interface TextCardProps extends BaseCardProps {
|
|
list?: never
|
|
text: string
|
|
}
|
|
|
|
export type CardProps = ListCardProps | TextCardProps
|
|
|
|
export type CheckboxProps =
|
|
| Omit<ListCardProps, "type">
|
|
| Omit<TextCardProps, "type">
|
|
export type RadioProps =
|
|
| Omit<ListCardProps, "type">
|
|
| Omit<TextCardProps, "type">
|