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