update hired page

This commit is contained in:
2026-08-11 19:17:40 +05:30
parent 8a256a4de7
commit 25c4ee4a6a
23 changed files with 2921 additions and 380 deletions

View File

@@ -3,7 +3,7 @@ import { useQuery } from '@tanstack/react-query';
import { base44 } from '@/api/base44Client';
import {
useApplications, useCourses, useInterviews, useJobPostings, useStaff,
useUserActivity, useWorkerProfiles,
useUserActivity, useWorkerProfile, useWorkerProfiles,
} from '@/lib/krowHooks';
import { buildFacts } from './insights';
import { createAssistantProvider } from './provider';
@@ -25,12 +25,16 @@ export function useAssistantFacts() {
const { data: activity = [] } = useUserActivity();
const { data: courses = [] } = useCourses();
// Krow AI serves Employer and Admin only, so it never reads the signed-in
// worker's own profile — that query also creates the record if absent, and it
// belongs to the talent portal, not here.
// The signed-in worker's own record, read from cache only: `enabled: false`
// means this never runs the query, which would *create* a WorkerProfile for an
// admin who has never opened Forge. So the Forge context is personal on pages
// that already loaded it, and falls back to library-level facts elsewhere
// rather than manufacturing a record as a side effect of opening a panel.
const { data: profile = null } = useWorkerProfile({ enabled: false });
return React.useMemo(
() => buildFacts({ applications, postings, interviews, staff, profiles, activity, courses }),
[applications, postings, interviews, staff, profiles, activity, courses]
() => buildFacts({ applications, postings, interviews, staff, profiles, activity, courses, profile }),
[applications, postings, interviews, staff, profiles, activity, courses, profile]
);
}