Bantayog Alert — Admin
-Phase 0 scaffolding. Admin dashboard arrives in Phase 3.
-Phase 0 scaffolding. Admin dashboard arrives in Phase 3.
-No responders on shift in your municipality.
+ ) : ( +Loading…
+ ) : error ? ( +Error: {error}
+ ) : rows.length === 0 ? ( +No active reports.
+ ) : ( +- Phase 0 scaffolding. Dispatch workflows arrive in Phase 4; native shell in Phase 6. -
-Loading…
+ if (!user) returnAccess denied: responder role required.
+ return <>{children}> +} diff --git a/apps/responder-app/src/hooks/useOwnDispatches.ts b/apps/responder-app/src/hooks/useOwnDispatches.ts new file mode 100644 index 00000000..d66948e1 --- /dev/null +++ b/apps/responder-app/src/hooks/useOwnDispatches.ts @@ -0,0 +1,57 @@ +import { useEffect, useState } from 'react' +import { collection, onSnapshot, query, where, orderBy } from 'firebase/firestore' +import type { Timestamp } from 'firebase/firestore' +import { db } from '../app/firebase' + +export interface OwnDispatchRow { + dispatchId: string + reportId: string + status: string + dispatchedAt: Timestamp + acknowledgementDeadlineAt?: Timestamp +} + +export function useOwnDispatches(uid: string | undefined) { + const [rows, setRows] = useStateFailed to load dispatches: {error}
} + {rows.length === 0 ? ( +No active dispatches.
+ ) : ( ++ Accept/Decline actions land in Phase 3c. +
+