import React from 'react'; import { cx } from '@leafygreen-ui/emotion'; import { useDarkMode } from '@leafygreen-ui/leafygreen-provider'; import { Description } from '@leafygreen-ui/typography'; import { descriptionClassName, getContentWrapperStyles, getDescriptionStyles, getLeftGlyphStyles, getRightGlyphStyles, getTitleStyles, inputOptionContentClassName, leftGlyphClassName, textContainerStyles, titleClassName, } from '../InputOptionContent/InputOptionContent.styles'; import { useInputOptionContext } from '../InputOptionContext'; import { InputOptionContentProps } from './InputOptionContent.types'; /** * @internal * * This is a temp workaround to add consistent option styles. * Once all components that use an input option are consistent * we can add this directly inside `InputOption`. */ export const InputOptionContent = ({ children, description, leftGlyph, rightGlyph, preserveIconSpace = true, className, ...rest }: InputOptionContentProps) => { const { disabled, highlighted, darkMode } = useInputOptionContext(); const { theme } = useDarkMode(darkMode); return (
{leftGlyph && (
{leftGlyph}
)}
{children}
{description && ( {description} )}
{rightGlyph && (
{rightGlyph}
)}
); }; InputOptionContent.displayName = 'InputOptionContent';