import { useContext } from 'react';
import { Sentiment } from '../../common';
import { ListItemContext, type ListItemContextData } from '../ListItemContext';
import { InlinePrompt, type InlinePromptProps } from '../../prompt';
export type ListItemPromptProps = Pick<
InlinePromptProps,
'children' | 'sentiment' | 'mediaLabel' | 'media' | 'loading'
>;
/**
* This component allows for rendering an Inline Prompt.
* In the future it will be a thin wrapper around a standalone component.
*
* Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.
*/
export const Prompt = ({
sentiment = Sentiment.NEUTRAL,
mediaLabel,
children,
media,
loading,
}: ListItemPromptProps) => {
const { ids, props } = useContext(ListItemContext);
const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);
return (
{isLongLivedMuted ? props.disabledPromptMessage : children}
);
};
Prompt.displayName = 'ListItem.Prompt';