10 lines
528 B
TypeScript
10 lines
528 B
TypeScript
import { usePage } from '@inertiajs/react';
|
|
import type { WorkContextState } from '@/types/work-context';
|
|
|
|
export function useConflictPreparationIdentity() {
|
|
const { auth, workContext, organizationAccess } = usePage().props;
|
|
const context = workContext as WorkContextState | null | undefined;
|
|
const access = organizationAccess as { permissions?: string[] } | null;
|
|
return `conflicts:${auth.user?.tenant_id}:${auth.user?.id}:${context?.active ?? 'legacy'}:${[...(access?.permissions ?? [])].sort().join(',')}`;
|
|
}
|