import { cn } from "../lib/utils.js";

/**
 * Renders text containing safe HTML formatting tags (strong, em, ul, ol, li)
 * preserved by the stripFoundryTags pipeline. All other HTML is already
 * stripped before reaching this component.
 */
export function RichDescription({
	text,
	className,
}: Readonly<{ text: string; className?: string }>) {
	const props = {
		className: cn(
			"[&_ol]:list-decimal [&_ol]:pl-4 [&_ul]:list-disc [&_ul]:pl-4",
			className,
		),
		dangerouslySetInnerHTML: { __html: text },
	};
	return <div {...props} />;
}
