dyomedea/src/components/gpx/GpxViewer.tsx

33 lines
730 B
TypeScript
Raw Normal View History

import { Component } from 'solid-js';
2023-01-03 10:39:17 +00:00
import { peekCachedSignal } from '../../workers/cached-signals';
import Tree from '../tree';
2023-01-03 11:07:23 +00:00
import GpxIcon from './GpxIcon';
interface Props {
gpxId: string;
2023-01-03 11:07:23 +00:00
restrictToHierarchy?: any;
}
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}
/>
);
};
export default GpxViewer;