From 427bb97abb3ca582bb9195b2da20b7f9f6c2c26f Mon Sep 17 00:00:00 2001 From: Kunerkhan Date: Fri, 22 Aug 2025 18:17:56 +0600 Subject: [PATCH] feat(AIFEP-20): Add react node type for label --- src/components/form/Checkbox/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/form/Checkbox/index.tsx b/src/components/form/Checkbox/index.tsx index 097f078..9f3eb3e 100644 --- a/src/components/form/Checkbox/index.tsx +++ b/src/components/form/Checkbox/index.tsx @@ -1,13 +1,13 @@ import clsx from 'clsx'; -import React, { useId } from 'react'; +import React, { type ReactNode, useId } from 'react'; import { Icon } from '~/components/common/Icon'; import { useCombinedPropsWithKit } from '~/hooks'; import styles from './styles.module.scss'; -export interface CheckboxProps extends React.AllHTMLAttributes { - label?: string; +export interface CheckboxProps extends React.InputHTMLAttributes { + label?: string | ReactNode; onChange?: (e: React.ChangeEvent) => void; } @@ -32,7 +32,7 @@ export const Checkbox = React.forwardRef((props
- {label &&

{label}

} + {typeof label === 'string' ?

{label}

: label} ); });