19 lines
469 B
TypeScript
19 lines
469 B
TypeScript
import * as React from "react"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
export interface HtmlDisplayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
html?: string | null;
|
|
}
|
|
|
|
export function HtmlDisplay({ html, className, ...props }: HtmlDisplayProps) {
|
|
if (!html) return null;
|
|
|
|
return (
|
|
<div
|
|
className={cn("prose prose-sm dark:prose-invert max-w-none [&>p]:m-0", className)}
|
|
dangerouslySetInnerHTML={{ __html: html }}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|