--- import type { ShareCandidateList } from '../../lib/community/share-candidates'; import { actions } from 'astro:actions'; import SafeExternalLink from '../SafeExternalLink.astro'; import ShareableContentIcon from './ShareableContentIcon.astro'; interface Props { candidates: ShareCandidateList | null; repo: string; error?: boolean; initialVisible?: number; loadStep?: number; } const { candidates, repo, error = false, initialVisible = 5, loadStep = 5, } = Astro.props; const candidateList = candidates && (candidates.events.length > 0 || candidates.documents.length > 0) ? candidates : null; const items = candidateList ? [...candidateList.events, ...candidateList.documents] .sort((a, b) => (b.date?.getTime() ?? 0) - (a.date?.getTime() ?? 0)) : []; function formatDate(date: Date | undefined): string { if (!date) return ''; return new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: 'numeric', }).format(date); } --- {error && (

Couldn’t load shareable records right now.

)} {!error && candidateList && (
{candidateList.events.length + candidateList.documents.length} found Events and Standard Site documents
)} {!error && !candidateList && (

No shareable events or Standard Site documents were found for {repo}. You can still share an AT URI.

)}