TrkViewer and TrksegViewer skeletons.

This commit is contained in:
vdv committed 2023-01-03 15:24:50 +01:00
1 parent 09ff9ca829
commit c1fe37d0a6
8 files changed
+88 -2

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
import { Component, For, from } from 'solid-js';
import { peekCachedSignal } from '../../workers/cached-signals';
import Tree from '../tree';
import TrkIcon from '../../icons/human-footprints-svgrepo-com.svg?component-solid';
import { TrksegViewer } from '../trkseg';
interface Props {
trkId: string;
restrictToHierarchy?: any;
}
const TrkViewer: Component<Props> = ({ trkId, restrictToHierarchy }) => {
const trk = peekCachedSignal({ id: trkId, method: 'getTrk' });
console.log({ caller: 'TrkViewer', trkId, restrictToHierarchy, trk: trk() });
const title = () => {
return trk().name;
};
return (
<Tree
title={
<>
<TrkIcon width='24' height='24' /> {title()}
</>
}
content={undefined}
subTree={
<For
each={Object.keys(restrictToHierarchy).filter((key: string) =>
key.startsWith('gpx/')
)}
>
{(key: string) => {
return <TrksegViewer trksegId={key} />;
}}
</For>
}
/>
);
};
export default TrkViewer;
+2
View File
@@ -1 +1,3 @@
export { default } from './Trk';
export { default as TrkViewer } from './TrkViewer';