Files
erika/components/html-display.tsx
T

19 lines
482 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 leading-snug", className)}
dangerouslySetInnerHTML={{ __html: html }}
{...props}
/>
)
}