()
| 45 | |
| 46 | const toolQueryKey = 'tool' |
| 47 | export const ToolPicker = () => { |
| 48 | // allTools comes from the ArticleContext which contains the list of tools available |
| 49 | const { defaultTool, detectedTools, allTools } = useArticleContext() |
| 50 | |
| 51 | if (!detectedTools.length) return null |
| 52 | |
| 53 | const options = detectedTools.map((value) => { |
| 54 | return { value, label: allTools[value] } |
| 55 | }) |
| 56 | |
| 57 | return ( |
| 58 | <InArticlePicker |
| 59 | fallbackValue={getDefaultTool(defaultTool, detectedTools)} |
| 60 | cookieKey="toolPreferred" |
| 61 | queryStringKey={toolQueryKey} |
| 62 | onValue={(value: string) => { |
| 63 | preserveAnchorNodePosition(document, () => { |
| 64 | showToolSpecificContent(value, Object.keys(allTools)) |
| 65 | }) |
| 66 | }} |
| 67 | preferenceName="application" |
| 68 | ariaLabel="Tool" |
| 69 | options={options} |
| 70 | /> |
| 71 | ) |
| 72 | } |
nothing calls this directly
no test coverage detected