fix: show collapsed sidebar activity indicators (#2116)
* fix: show collapsed sidebar activity indicators * test: cover collapsed sidebar activity rollups * style(ui): unify collapsed activity indicator --------- Co-authored-by: Iuliia Ivashko <yulia.ivashko@gmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Iuliia Ivashko
parent
4c7b87bb21
commit
76b2ab2588
@@ -0,0 +1,39 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '@/components/icon/Icon';
|
||||
import { cn } from '@/lib/utils';
|
||||
import type { CollapsedActivityState } from './collapsedActivityState';
|
||||
|
||||
export function CollapsedActivityIndicator({
|
||||
state,
|
||||
activeLabel,
|
||||
unreadLabel,
|
||||
className,
|
||||
}: {
|
||||
state: Exclude<CollapsedActivityState, null>;
|
||||
activeLabel: string;
|
||||
unreadLabel: string;
|
||||
className?: string;
|
||||
}): React.ReactNode {
|
||||
const label = state === 'active' ? activeLabel : unreadLabel;
|
||||
if (state === 'active') {
|
||||
return (
|
||||
<Icon
|
||||
name="loader-4"
|
||||
className={cn('h-3 w-3 shrink-0 animate-spin text-primary', className)}
|
||||
aria-label={label}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
'h-1.5 w-1.5 shrink-0 rounded-full',
|
||||
'bg-[var(--status-info)]',
|
||||
className,
|
||||
)}
|
||||
aria-label={label}
|
||||
title={label}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user