diff --git a/src/components/Sns/SnsFilterPanel.tsx b/src/components/Sns/SnsFilterPanel.tsx index 6c914a0..f514f94 100644 --- a/src/components/Sns/SnsFilterPanel.tsx +++ b/src/components/Sns/SnsFilterPanel.tsx @@ -8,6 +8,7 @@ interface Contact { displayName: string avatarUrl?: string postCount?: number + postCountStatus?: 'loading' | 'ready' | 'error' } interface SnsFilterPanelProps { @@ -58,6 +59,16 @@ export const SnsFilterPanel: React.FC = ({ setJumpTargetDate(undefined) } + const getPostCountDisplay = (contact: Contact) => { + if (contact.postCountStatus === 'error') { + return { text: '统计失败', className: 'is-error' } + } + if (contact.postCountStatus !== 'ready') { + return { text: '统计中', className: 'is-loading' } + } + return { text: `${Math.max(0, Number(contact.postCount || 0))} 条`, className: '' } + } + return (