2023-01-02 16:27:55 +00:00
|
|
|
import { Component } from 'solid-js';
|
2023-01-03 10:39:17 +00:00
|
|
|
import { peekCachedSignal } from '../../workers/cached-signals';
|
2023-01-02 16:27:55 +00:00
|
|
|
import Tree from '../tree';
|
2023-01-03 11:07:23 +00:00
|
|
|
import GpxIcon from './GpxIcon';
|
2023-01-02 16:27:55 +00:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
gpxId: string;
|
2023-01-03 11:07:23 +00:00
|
|
|
restrictToHierarchy?: any;
|
2023-01-02 16:27:55 +00:00
|
|
|
}
|
|
|
|
|
2023-01-03 11:07:23 +00:00
|
|
|
const GpxViewer: Component<Props> = ({ gpxId, restrictToHierarchy }) => {
|
2023-01-03 10:39:17 +00:00
|
|
|
const gpx = peekCachedSignal({ id: gpxId, method: 'getGpx' });
|
2023-01-03 11:07:23 +00:00
|
|
|
console.log({ caller: 'GpxViewer', gpxId, restrictToHierarchy, gpx: gpx() });
|
|
|
|
const title = () => {
|
|
|
|
return gpx().metadata.name;
|
|
|
|
};
|
|
|
|
return (
|
|
|
|
<Tree
|
|
|
|
title={
|
|
|
|
<>
|
|
|
|
<GpxIcon />
|
|
|
|
{' '}
|
|
|
|
{title()}
|
|
|
|
</>
|
|
|
|
}
|
|
|
|
content={undefined}
|
|
|
|
subTree={undefined}
|
|
|
|
/>
|
|
|
|
);
|
2023-01-02 16:27:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default GpxViewer;
|