mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-02 10:02:12 +00:00
migrate component
This commit is contained in:
@@ -9,18 +9,23 @@
|
|||||||
import { fileActions } from '$lib/logic/file-actions';
|
import { fileActions } from '$lib/logic/file-actions';
|
||||||
import { selection } from '$lib/logic/selection';
|
import { selection } from '$lib/logic/selection';
|
||||||
|
|
||||||
export let poi: PopupItem<any>;
|
let {
|
||||||
|
poi,
|
||||||
|
}: {
|
||||||
|
poi: PopupItem<any>;
|
||||||
|
} = $props();
|
||||||
|
|
||||||
let tags: { [key: string]: string } = {};
|
let tags: Record<string, string> = $derived(poi ? JSON.parse(poi.item.tags) : {});
|
||||||
let name = '';
|
let name = $derived.by(() => {
|
||||||
$: if (poi) {
|
if (poi) {
|
||||||
tags = JSON.parse(poi.item.tags);
|
if (tags.name !== undefined && tags.name !== '') {
|
||||||
if (tags.name !== undefined && tags.name !== '') {
|
return tags.name;
|
||||||
name = tags.name;
|
} else {
|
||||||
} else {
|
return i18n._(`layers.label.${poi.item.query}`);
|
||||||
name = i18n._(`layers.label.${poi.item.query}`);
|
}
|
||||||
}
|
}
|
||||||
}
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
function addToFile() {
|
function addToFile() {
|
||||||
const desc = Object.entries(tags)
|
const desc = Object.entries(tags)
|
||||||
@@ -74,7 +79,7 @@
|
|||||||
<ScrollArea class="flex flex-col max-h-[30dvh]">
|
<ScrollArea class="flex flex-col max-h-[30dvh]">
|
||||||
{#if tags.image || tags['image:0']}
|
{#if tags.image || tags['image:0']}
|
||||||
<div class="w-full rounded-md overflow-clip my-2 max-w-96 mx-auto">
|
<div class="w-full rounded-md overflow-clip my-2 max-w-96 mx-auto">
|
||||||
<!-- svelte-ignore a11y-missing-attribute -->
|
<!-- svelte-ignore a11y_missing_attribute -->
|
||||||
<img src={tags.image ?? tags['image:0']} />
|
<img src={tags.image ?? tags['image:0']} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user