2023-06-06 14:31:27 -05:00
|
|
|
import { WorkbenchMenu } from 'shared/components/workbench/menus/shared/index.mjs'
|
2023-06-15 18:33:30 +02:00
|
|
|
import { MeasieIcon } from 'shared/components/icons.mjs'
|
2023-06-06 14:31:27 -05:00
|
|
|
import { SampleItem } from './options.mjs'
|
|
|
|
|
|
|
|
export const ns = ['measurements', 'test-view', 'workbench']
|
|
|
|
|
|
|
|
export const TestMeasurements = ({
|
|
|
|
patternConfig,
|
|
|
|
settings,
|
|
|
|
update,
|
|
|
|
language,
|
|
|
|
account,
|
|
|
|
DynamicDocs = false,
|
|
|
|
}) => {
|
|
|
|
const menuStructure = {}
|
|
|
|
patternConfig.measurements.forEach((m) => (menuStructure[m] = m))
|
|
|
|
const getDocsPath = (measie) => `measurements/${measie}`
|
|
|
|
return (
|
|
|
|
<WorkbenchMenu
|
|
|
|
{...{
|
|
|
|
config: menuStructure,
|
|
|
|
control: account.control,
|
|
|
|
DynamicDocs,
|
|
|
|
getDocsPath,
|
2023-06-15 18:33:30 +02:00
|
|
|
Icon: MeasieIcon,
|
2023-06-06 14:31:27 -05:00
|
|
|
Item: SampleItem,
|
|
|
|
name: 'measurements',
|
|
|
|
language,
|
|
|
|
ns,
|
|
|
|
passProps: { settings, type: 'measurement' },
|
|
|
|
updateFunc: (path, value) => {
|
|
|
|
if (value) update.settings(['sample'], { type: 'measurement', measurement: path[0] })
|
|
|
|
else update.settings(['sample'])
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|