| 30 | } |
| 31 | |
| 32 | function getDefaultTool(defaultTool: string | undefined, detectedTools: Array<string>): string { |
| 33 | // If there is a default tool and the tool is present on this page |
| 34 | if (defaultTool && detectedTools.includes(defaultTool)) return defaultTool |
| 35 | |
| 36 | // Default to webui if present (this is generally the case where we show UI/CLI/Desktop info) |
| 37 | if (detectedTools.includes('webui')) return 'webui' |
| 38 | |
| 39 | // Default to cli if present (this is generally the case where we show curl/CLI info) |
| 40 | if (detectedTools.includes('cli')) return 'cli' |
| 41 | |
| 42 | // Otherwise, just choose the first detected tool |
| 43 | return detectedTools[0] |
| 44 | } |
| 45 | |
| 46 | const toolQueryKey = 'tool' |
| 47 | export const ToolPicker = () => { |