mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-18 01:35:13 +00:00
26 lines
709 B
TypeScript
26 lines
709 B
TypeScript
import type { ComponentType } from 'react';
|
|
import type { PendingPermissionRequest } from '../../types/types';
|
|
|
|
export interface PermissionPanelProps {
|
|
request: PendingPermissionRequest;
|
|
onDecision: (
|
|
requestIds: string | string[],
|
|
decision: { allow?: boolean; message?: string; updatedInput?: unknown },
|
|
) => void;
|
|
}
|
|
|
|
const registry: Record<string, ComponentType<PermissionPanelProps>> = {};
|
|
|
|
export function registerPermissionPanel(
|
|
toolName: string,
|
|
component: ComponentType<PermissionPanelProps>,
|
|
): void {
|
|
registry[toolName] = component;
|
|
}
|
|
|
|
export function getPermissionPanel(
|
|
toolName: string,
|
|
): ComponentType<PermissionPanelProps> | null {
|
|
return registry[toolName] || null;
|
|
}
|