github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/layout/Dashboard/DashboardProgress.tsx (about) 1 import { DashboardDataModeLive } from "../../../../types"; 2 import { useDashboard } from "../../../../hooks/useDashboard"; 3 4 const DashboardProgress = () => { 5 const { dataMode, progress, state } = useDashboard(); 6 7 // We only show a progress indicator in live mode 8 if (dataMode !== DashboardDataModeLive) { 9 return null; 10 } 11 12 return ( 13 <div className="w-full h-[4px] bg-dashboard print:hidden"> 14 {state === "running" ? ( 15 <div 16 className="h-full bg-black-scale-3" 17 style={{ width: `${progress}%` }} 18 /> 19 ) : null} 20 </div> 21 ); 22 }; 23 24 export default DashboardProgress;