import {
type HTMLAttributes,
type ReactElement,
type ReactNode,
type Ref,
} from "react";
import { type PropsWithRef } from "../types.js";
import { listItemText } from "./listItemStyles.js";
/**
* @internal
*/
export interface ListItemTextProps extends HTMLAttributes {
ref?: Ref;
secondaryText?: ReactNode;
secondaryTextProps?: PropsWithRef>;
/** @defaultValue `false` */
secondaryTextClamped?: boolean;
secondaryTextClassName?: string;
}
/**
* This is mostly an internal component that can conditionally render secondary
* text within list items.
*
* @internal
*/
export function ListItemText(props: ListItemTextProps): ReactElement {
const {
ref,
className,
secondaryText,
secondaryTextProps,
secondaryTextClamped = false,
secondaryTextClassName,
children,
...remaining
} = props;
return (
{children}
{secondaryText && (
{secondaryText}
)}
);
}