import { parseLabelSection, isLabelSectionHeader, type LabelBlock } from '../../../util/drug_interactions' /** * Renders flattened FDA label section text as readable blocks: bullet lists, the * muted section header, and paragraphs whose subsection number ("7.1") shows as a * small badge. FDA wording is kept verbatim (see util/drug_interactions.ts); this * only structures it. Shared by the interaction comparison view and the * single-drug detail page. */ export default function LabelBlocks({ text, tone = 'default', }: { text: string | null | undefined tone?: 'default' | 'danger' }) { const blocks = parseLabelSection(text) if (blocks.length === 0) return null const bodyColor = tone === 'danger' ? 'text-red-800' : 'text-gray-800' return (
{block.text!.replace(/^\s*\d{1,2}\s+/, '')}
) } return ({block.label && ( {block.label} )} {block.text}
) }