2 import DetailsLink from '../components/DetailsLink.svelte';
3 import PageLink from '../components/PageLink.svelte';
5 formatPlaceType, osmLink, formatAdminLevel, formatDistance
6 } from '../lib/helpers.js';
8 export let addressLine;
9 export let bDistanceInMeters;
11 $: bAddressLineUsed = addressLine.isaddress;
15 <tr class:notused={!bAddressLineUsed}>
16 <td class="name font-weight-bold">
17 {#if addressLine.localname}
18 {addressLine.localname}
20 <span class="noname">No Name</span>
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>
29 {#if addressLine.osm_id}
30 <DetailsLink feature={addressLine}>details</DetailsLink>
31 {:else if addressLine.type.match(/^country/)}
32 <PageLink page='search', params_hash={{ country: addressLine.localname }}>search by name</PageLink>
33 {:else if addressLine.type === 'postcode'}
34 <PageLink page='search', params_hash={{ postalcode: addressLine.localname }}>search by name</PageLink>