import { memo, useMemo } from "react"; import Icon from "../../utils/Icon"; import { renderPossiblyHtml } from '../../utils/html'; const Premium = memo(({ bullets }: { bullets?: string[] | string[][] }) => { if (!bullets || bullets.length === 0) return null; /** * Normalize bullets */ const rows = useMemo(() => { const isRowArray = Array.isArray(bullets[0]); return isRowArray ? bullets : bullets.map((b) => [b]); }, [bullets]); return (
{rows.map((row, rowIndex) => (
{row.map((bullet, colIndex) => { const baseText = typeof bullet === "string" ? bullet : bullet?.text; const baseIcon = typeof bullet === "string" ? "check" : bullet?.icon ?? "check"; return (
{renderPossiblyHtml(baseText)}
); })}
))}
); }); export default Premium;