forked from sagnik/Velocity-OS
Initial commit: Velocity-OS migration
This commit is contained in:
34
webos/src/shared/hooks/useKanban.ts
Normal file
34
webos/src/shared/hooks/useKanban.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { api } from '@/shared/lib/apiClient';
|
||||
|
||||
/**
|
||||
* useKanban — Pipeline Pillar kanban board data
|
||||
* Returns leads grouped by stage.
|
||||
*/
|
||||
export function useKanban() {
|
||||
const query = useQuery({
|
||||
queryKey: ['kanban'],
|
||||
queryFn: () => api.get<KanbanStage[]>('/crm/pipeline/kanban'),
|
||||
staleTime: 30_000,
|
||||
refetchInterval: 60_000,
|
||||
});
|
||||
return { stages: query.data ?? [], isLoading: query.isLoading };
|
||||
}
|
||||
|
||||
export interface KanbanStage {
|
||||
id: string;
|
||||
label: string;
|
||||
emoji: string;
|
||||
leads: KanbanLead[];
|
||||
}
|
||||
|
||||
export interface KanbanLead {
|
||||
id: string;
|
||||
name: string;
|
||||
location?: string;
|
||||
qdScore: number;
|
||||
qdDelta?: number;
|
||||
lastContactRelative: string;
|
||||
lastContactChannel: string;
|
||||
isVaultActive?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user