Displaying waypoints (and installing a plugin to import SVG files as components)
This commit is contained in:
1 parent
6b0b394d33
commit
62b2b5552a
8 files changed
+255
-14
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import { Component } from 'solid-js';
|
||||
import WptIcon from '../../icons/location-pin-svgrepo-com.svg?component-solid';
|
||||
import { peekCachedSignal } from '../../workers/cached-signals';
|
||||
import Tree from '../tree';
|
||||
|
||||
interface Props {
|
||||
wptId: string;
|
||||
}
|
||||
|
||||
const WptViewer: Component<Props> = ({ wptId }) => {
|
||||
const wpt = peekCachedSignal({ id: wptId, method: 'getWpt' });
|
||||
console.log({ caller: 'WptViewer', wptId, wpt: wpt() });
|
||||
const title = () => {
|
||||
return wpt().name;
|
||||
};
|
||||
|
||||
return (
|
||||
<Tree
|
||||
title={
|
||||
<>
|
||||
<WptIcon /> {title()}
|
||||
</>
|
||||
}
|
||||
content={undefined}
|
||||
subTree={undefined}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default WptViewer;
|
||||
@@ -1 +1,3 @@
|
||||
export { default } from './Wpt';
|
||||
|
||||
export { default as WptViewer } from './WptViewer';
|
||||
Reference in new issue
Block a user