diff --git a/packages/react-front-kit-shared/src/types/items.ts b/packages/react-front-kit-shared/src/types/items.ts index dcf63e6d..1de7eda1 100644 --- a/packages/react-front-kit-shared/src/types/items.ts +++ b/packages/react-front-kit-shared/src/types/items.ts @@ -1,8 +1,8 @@ +import type { IOption } from '../../dist'; import type { ReactNode } from 'react'; -export interface IItem { - label: ReactNode; - value: T; +export interface IItem extends IOption { + content?: ReactNode; } -export type IItems = IItems[]; +export type IItems = IItem[]; diff --git a/packages/react-front-kit/src/Components/ButtonsListOrDropdown/ButtonsListOrDropdown.tsx b/packages/react-front-kit/src/Components/ButtonsListOrDropdown/ButtonsListOrDropdown.tsx index d00b614f..3ac7256f 100644 --- a/packages/react-front-kit/src/Components/ButtonsListOrDropdown/ButtonsListOrDropdown.tsx +++ b/packages/react-front-kit/src/Components/ButtonsListOrDropdown/ButtonsListOrDropdown.tsx @@ -1,6 +1,7 @@ 'use client'; import type { ButtonProps, MenuProps } from '@mantine/core'; -import type { ReactElement, ReactNode } from 'react'; +import type { IItems } from '@smile/react-front-kit-shared'; +import type { ReactElement } from 'react'; import { Button, Menu, createStyles } from '@mantine/core'; import { useUncontrolled } from '@mantine/hooks'; @@ -16,7 +17,7 @@ export interface IButtonsListOrDropdownProps extends MenuProps { buttonProps?: ButtonProps; current?: string; defaultCurrent: string; - items: { label: ReactNode; value: string }[]; + items: IItems; menuIfValueGreaterThan?: number; onAction?: () => void; }