import type { CacheIndicatorState } from '../../cache-indicator' import { css } from '../../utils/css' export enum Status { None = 'none', Rendering = 'rendering', Compiling = 'compiling', Prerendering = 'prerendering', CacheBypassing = 'cache-bypassing', } export function getCurrentStatus( buildingIndicator: boolean, renderingIndicator: boolean, cacheIndicator: CacheIndicatorState ): Status { const isCacheFilling = cacheIndicator === 'filling' // Priority order: compiling > prerendering > rendering // Note: cache bypassing is now handled as a badge, not a status indicator if (buildingIndicator) { return Status.Compiling } if (isCacheFilling) { return Status.Prerendering } if (renderingIndicator) { return Status.Rendering } return Status.None } interface StatusIndicatorProps { status: Status onClick?: () => void } export function StatusIndicator({ status, onClick }: StatusIndicatorProps) { const statusText: Record = { [Status.None]: '', [Status.CacheBypassing]: 'Cache disabled', [Status.Prerendering]: 'Prerendering', [Status.Compiling]: 'Compiling', [Status.Rendering]: 'Rendering', } // Status dot colors const statusDotColor: Record = { [Status.None]: '', [Status.CacheBypassing]: '', // No dot for bypass, uses full pill color [Status.Prerendering]: '#f5a623', [Status.Compiling]: '#f5a623', [Status.Rendering]: '#50e3c2', } if (status === Status.None) { return null } return ( <> ) } function AnimateStatusText({ children: text, showEllipsis = true, }: { children: string statusKey?: string // Keep for type compatibility but unused showEllipsis?: boolean }) { return (
{text} {showEllipsis && ( . . . )}
) }