]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/components/DetailsOneRow.svelte
Components for internal links (#69)
[nominatim-ui.git] / src / components / DetailsOneRow.svelte
1 <script>
2   import DetailsLink from '../components/DetailsLink.svelte';
3
4   export let addressLine;
5   export let bDistanceInMeters;
6
7   $: bAddressLineUsed = addressLine.isaddress;
8
9   import {
10     formatPlaceType, osmLink, formatAdminLevel, formatDistance
11   } from '../lib/helpers.js';
12
13 </script>
14
15 <tr class:notused={!bAddressLineUsed}>
16   <td class="name">
17     {#if addressLine.localname}
18       {addressLine.localname}
19     {:else}
20       <span class="noname">No Name</span>
21     {/if}
22   </td>
23   <td>{formatPlaceType(addressLine)}</td>
24   <td>{@html osmLink(addressLine)}</td>
25   <td>{addressLine.rank_address}</td>
26   <td>{formatAdminLevel(addressLine.admin_level)}</td>
27   <td>{@html formatDistance(addressLine.distance, bDistanceInMeters)}</td>
28   <td>{#if addressLine.osm_id}<DetailsLink feature={addressLine}>details</DetailsLink>{/if}</td>
29 </tr>
30
31 <style>
32   .notused {
33     color:#ddd;
34   }
35   .name{
36     font-weight: bold;
37   }
38   .noname{
39     color:#800;
40   }
41 </style>