Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/components/stance/CoverageLine.tsx from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/stance/CoverageLine.tsx
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/components/stance/CoverageLine.tsx
-
curl -L -o CoverageLine.tsx https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/stance/CoverageLine.tsx
1.34 kB
| import { useQuery } from '@tanstack/react-query' | |
| import { fetchRecordedCoverage } from '../../api/sitesTimeline' | |
| import { coverageText, type CoverageScope } from '../../utils/coverageLine' | |
| import './CoverageLine.css' | |
| /** | |
| * The recording-coverage line (#1348), under a story's basis line on the Overview and the home hero: "From recordings of 29 | |
| * Florida local governments (1,035 meetings). Many Florida governments aren't in our recordings yet." It reads the same scope | |
| * as the counts above it (label and data move together) and renders nothing until the real counts are in. Phones show the | |
| * short form. | |
| */ | |
| export default function CoverageLine({ scope, className = '' }: { scope: CoverageScope; className?: string }) { | |
| const city = scope.stateCode ? scope.city : null | |
| const q = useQuery({ | |
| queryKey: ['coverage', 'recorded-meetings', scope.stateCode ?? '', city ?? ''], | |
| queryFn: () => fetchRecordedCoverage(scope.stateCode, city), | |
| staleTime: 30 * 60_000, | |
| retry: 1, | |
| }) | |
| const text = coverageText(q.data, scope) | |
| if (!text) return null | |
| return ( | |
| <p className={`coverage-line ${className}`.trim()} data-testid="coverage-line"> | |
| <span className="coverage-line-full">{text.full}</span> | |
| <span className="coverage-line-short" aria-hidden="true"> | |
| {text.short} | |
| </span> | |
| </p> | |
| ) | |
| } | |