import { PropsWithChildren, useContext } from 'react'; import { ListItemContext, type ListItemContextData } from '../ListItemContext'; import Body from '../../body'; import Link, { type LinkProps } from '../../link'; import { Typography } from '../../common'; export type ListItemAdditionalInfoProps = PropsWithChildren<{ /** * Props object to be passed to the [Link](https://storybook.wise.design/?path=/docs/typography-link--docs) component. */ action?: { label: string } & Pick; }>; export const AdditionalInfo = function ({ children, action }: ListItemAdditionalInfoProps) { const { ids } = useContext(ListItemContext); return ( {children} {action ? ( <> {' '} {action.label} ) : null} ); }; AdditionalInfo.displayName = 'ListItem.AdditionalInfo';