import { memo } from 'react' import { GrFlag, GrCompliance, GrDown, GrSync, GrUp } from 'react-icons/gr' import { IssueTitle } from './title' import type { FeedComponentProps } from './interface' const thumbSize = { width: 12, height: 12 } // heading block for feed entry displaying website title that can toggle parent list. export const FeedHeadingComponent = ({ onToggleSection, onScanEvent, pageUrl, sectionHidden, totalIssues, highLight, }: Partial & { onToggleSection(x: (x: boolean) => boolean): void sectionHidden?: boolean pageUrl: string totalIssues: number highLight?: boolean }) => { const onScan = async () => { if (typeof onScanEvent === 'function') { try { await onScanEvent(pageUrl) } catch (e) { console.error(e) } } } const onToggle = () => onToggleSection((v: boolean) => !v) const hlight = highLight || totalIssues === 0 return (
{totalIssues} issue{totalIssues === 1 ? '' : 's'}
{hlight ? ( highLight ? ( ) : ( ) ) : null}
{onScanEvent ? ( ) : null} {totalIssues ? ( ) : null}
) } export const FeedHeading = memo(FeedHeadingComponent)