MCPcopy
hub / github.com/premieroctet/openchakra / ImportMenuItem

Function ImportMenuItem

src/components/headerMenu/ImportMenuItem.tsx:7–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import useDispatch from '~hooks/useDispatch'
6
7const ImportMenuItem = () => {
8 const dispatch = useDispatch()
9
10 return (
11 <MenuItem
12 onClick={async () => {
13 const components = await loadFromJSON()
14 dispatch.components.reset(components)
15 }}
16 >
17 <Box mr={2} as={FiUpload} />
18 Import components
19 </MenuItem>
20 )
21}
22
23export default ImportMenuItem

Callers

nothing calls this directly

Calls 2

loadFromJSONFunction · 0.90
useDispatchFunction · 0.85

Tested by

no test coverage detected