()
| 34 | const [editingCmd, setEditingCmd] = useState<{ originalName: string, name: string, template: string } | null>(null); |
| 35 | |
| 36 | const fetchCommands = async () => { |
| 37 | try { |
| 38 | setLoading(true); |
| 39 | const data = await getCommands(); |
| 40 | const entries = Object.entries(data).map(([name, value]) => ({ |
| 41 | name, |
| 42 | template: value.template, |
| 43 | })); |
| 44 | setCommands(entries); |
| 45 | } catch (err: any) { |
| 46 | toast.error("Failed to load commands"); |
| 47 | console.error(err); |
| 48 | } finally { |
| 49 | setLoading(false); |
| 50 | } |
| 51 | }; |
| 52 | |
| 53 | useEffect(() => { |
| 54 | fetchCommands(); |
no test coverage detected