@ -2,7 +2,7 @@ import { useState, type ReactNode } from 'react'
import { Link , useNavigate } from 'react-router-dom'
import { formatINR } from '@sims/domain'
import { Badge , DataTable , EmptyState , ErrorState , Notice , Skeleton , StatCard , Stats } from '@sims/ui'
import { displayName , getDashboard , getSmsBalances , isManagerial } from '../api'
import { displayName , getDashboard , getSmsBalances , getStalledProjects, isManagerial } from '../api'
import { QueueActions , RULE_LABEL , reminderTone } from '../components/ReminderQueue'
import { useData } from './Clients'
@ -34,6 +34,7 @@ export function Dashboard() {
const [ mine , setMine ] = useState ( false )
const dash = useData ( ( ) = > getDashboard ( mine ) , [ mine ] )
const smsLow = useData ( getSmsBalances , [ ] ) // D28: low-balance alert, seen even without opening the SMS screen
const stalled = useData ( getStalledProjects , [ ] ) // parked onboarding — active projects with no recent progress
const [ err , setErr ] = useState ( '' )
const v = dash . data
const name = displayName ( )
@ -144,6 +145,13 @@ export function Dashboard() {
) ) }
< / Card >
< Card title = "Onboarding stalled" count = { stalled . data ? . length ? ? 0 } empty = "Nothing stalled." isEmpty = { ( stalled . data ? ? [ ] ) . length === 0 } >
{ ( stalled . data ? ? [ ] ) . map ( ( p ) = > (
< Row key = { p . clientModuleId } onClick = { ( ) = > nav ( ` /clients/ ${ p . clientId } ?tab=modules ` ) }
title = { p . clientName } sub = { p . module Name } / >
) ) }
< / Card >
< Card title = "Follow-ups today" count = { v . followUpsToday . length } empty = "No follow-ups due." isEmpty = { v . followUpsToday . length === 0 } >
{ v . followUpsToday . map ( ( f ) = > (
< Row key = { f . id } onClick = { ( ) = > nav ( ` /clients/ ${ f . clientId } ` ) }