(props: SectionProps)
| 579 | } |
| 580 | |
| 581 | export function SectionView(props: SectionProps): JSX.Element { |
| 582 | const { section } = props; |
| 583 | const allChips = section.rows.length > 0 && section.rows.every((row) => row.display === 'chip'); |
| 584 | return ( |
| 585 | <section |
| 586 | className="atlas-twin-section" |
| 587 | data-testid={`codeatlas-twin-section-${section.name}`} |
| 588 | data-populated={section.populated} |
| 589 | data-block={section.block} |
| 590 | data-alarm={ALARM_SECTIONS.has(section.name)} |
| 591 | > |
| 592 | {section.block !== undefined && ( |
| 593 | <div className="atlas-twin-block-label" data-testid={`codeatlas-twin-block-${section.block}`}> |
| 594 | {BLOCK_LABELS[section.block]} |
| 595 | </div> |
| 596 | )} |
| 597 | <header className="atlas-twin-section-head"> |
| 598 | <h3 className="atlas-twin-section-title" data-icon={section.icon}> |
| 599 | {section.title} |
| 600 | </h3> |
| 601 | {section.countLabel !== undefined && ( |
| 602 | <span className="atlas-twin-section-count" data-testid="codeatlas-section-count"> |
| 603 | {section.countLabel} |
| 604 | </span> |
| 605 | )} |
| 606 | <StateMarker state={section.state} subject={section.subject} note={section.stateNote} /> |
| 607 | {section.factPath.length > 0 && ( |
| 608 | <EvidenceBlock |
| 609 | factPath={section.factPath} |
| 610 | open={props.openEvidence === section.factPath} |
| 611 | entries={props.openEvidence === section.factPath ? props.entriesFor(section.factPath) : []} |
| 612 | onToggle={props.onToggleEvidence} |
| 613 | /> |
| 614 | )} |
| 615 | </header> |
| 616 | {section.text !== undefined && section.text.length > 0 && ( |
| 617 | <p |
| 618 | className="atlas-twin-section-text" |
| 619 | data-testid={`codeatlas-twin-text-${section.name}`} |
| 620 | data-sentence={`section-${section.name}-text`} |
| 621 | data-voiced={props.voiceOf(`section-${section.name}-text`) !== undefined} |
| 622 | > |
| 623 | {props.voiceOf(`section-${section.name}-text`) ?? section.text} |
| 624 | {props.voiceOf(`section-${section.name}-text`) !== undefined && <VoiceMarker />} |
| 625 | </p> |
| 626 | )} |
| 627 | {section.rows.length === 0 && section.emptyText.length > 0 && ( |
| 628 | <p |
| 629 | className="atlas-twin-section-empty" |
| 630 | data-testid={`codeatlas-twin-empty-${section.name}`} |
| 631 | data-sentence={`section-${section.name}-empty`} |
| 632 | data-voiced={props.voiceOf(`section-${section.name}-empty`) !== undefined} |
| 633 | > |
| 634 | {props.voiceOf(`section-${section.name}-empty`) ?? section.emptyText} |
| 635 | {props.voiceOf(`section-${section.name}-empty`) !== undefined && <VoiceMarker />} |
| 636 | </p> |
| 637 | )} |
| 638 | {section.rows.length > 0 && ( |
nothing calls this directly
no test coverage detected