diff --git a/frontend/src/pages/ScriptLibraryPage.tsx b/frontend/src/pages/ScriptLibraryPage.tsx new file mode 100644 index 00000000..e51445ba --- /dev/null +++ b/frontend/src/pages/ScriptLibraryPage.tsx @@ -0,0 +1,50 @@ +import { useState, useEffect } from 'react' +import { useScriptGeneratorStore } from '@/store/scriptGeneratorStore' +import { ScriptFilterBar } from '@/components/scripts/ScriptFilterBar' +import { ScriptTemplateList } from '@/components/scripts/ScriptTemplateList' +import { ScriptGeneratorPanel } from '@/components/scripts/ScriptGeneratorPanel' + +export default function ScriptLibraryPage() { + // inputValue is owned here so ScriptFilterBar and ScriptTemplateList + // can coordinate clear-search without direct coupling. + const [inputValue, setInputValue] = useState('') + const loadCategories = useScriptGeneratorStore(s => s.loadCategories) + const loadTemplates = useScriptGeneratorStore(s => s.loadTemplates) + const setSearch = useScriptGeneratorStore(s => s.setSearch) + + useEffect(() => { + // loadCategories must complete before loadTemplates can resolve slugs + loadCategories().then(() => loadTemplates()) + }, [loadCategories, loadTemplates]) + + const onClearSearch = () => { + setInputValue('') + setSearch('') + } + + return ( +
+ Browse PowerShell templates, fill in parameters, and generate ready-to-run scripts. +
+