mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-04-23 05:51:33 +00:00
20 lines
642 B
TypeScript
20 lines
642 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
import type { PendingPermissionRequest } from '../components/chat/types/types';
|
|
|
|
export interface PermissionContextValue {
|
|
pendingPermissionRequests: PendingPermissionRequest[];
|
|
handlePermissionDecision: (
|
|
requestIds: string | string[],
|
|
decision: { allow?: boolean; message?: string; rememberEntry?: string | null; updatedInput?: unknown },
|
|
) => void;
|
|
}
|
|
|
|
const PermissionContext = createContext<PermissionContextValue | null>(null);
|
|
|
|
export function usePermission(): PermissionContextValue | null {
|
|
return useContext(PermissionContext);
|
|
}
|
|
|
|
export default PermissionContext;
|