Portal/rsconcept/frontend/src/features/ai/stores/use-available-variables.tsx

18 lines
725 B
TypeScript
Raw Normal View History

2025-07-13 17:58:32 +03:00
import { PromptVariableType } from '../models/prompting';
import { useAIStore } from './ai-context';
export function useAvailableVariables(): PromptVariableType[] {
const hasCurrentOSS = useAIStore(state => !!state.currentOSS);
const hasCurrentSchema = useAIStore(state => !!state.currentSchema);
const hasCurrentBlock = useAIStore(state => !!state.currentBlock);
const hasCurrentConstituenta = useAIStore(state => !!state.currentConstituenta);
return [
...(hasCurrentOSS ? [PromptVariableType.OSS] : []),
...(hasCurrentSchema ? [PromptVariableType.SCHEMA] : []),
...(hasCurrentBlock ? [PromptVariableType.BLOCK] : []),
...(hasCurrentConstituenta ? [PromptVariableType.CONSTITUENTA] : [])
];
}