import type { DrugInteractionEntry } from '../../../types/drug_reference' import { PRODUCT_TYPES } from '../../../types/drug_reference' import LabelBlocks from './LabelBlocks' interface Props { entry: DrugInteractionEntry onRemove: (id: number) => void } /** * One column in the side-by-side drug interaction comparison view. * * Shows the drug identity (brand + generic name, OTC/Rx badge), then the * drug_interactions text from the FDA label, or a muted "No labeled * interaction text" note when the field is absent. */ export default function InteractionColumn({ entry, onRemove }: Props) { const isRx = entry.product_type === PRODUCT_TYPES.RX const isOtc = entry.product_type === PRODUCT_TYPES.OTC const displayName = entry.brand_name ?? entry.generic_name ?? 'Unknown Drug' return (
{/* Column header — fixed min-height so columns line up even when names wrap */}
{displayName} {isRx && ( Rx )} {isOtc && ( OTC )}
{entry.brand_name && entry.generic_name && (

{entry.generic_name}

)}
{/* Label text, parsed into readable blocks (FDA wording kept verbatim). */}
{entry.drug_interactions ? ( ) : (

No labeled interaction text on this label.

)}
) }