X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/f51f2a70794858f9c8fb5d75ecd40fd1e4ec3897..049113b86651547e73678f05c80f385feb20ada4:/src/components/DetailsOneRow.svelte

diff --git a/src/components/DetailsOneRow.svelte b/src/components/DetailsOneRow.svelte
index 1ab566d..cd74d93 100644
--- a/src/components/DetailsOneRow.svelte
+++ b/src/components/DetailsOneRow.svelte
@@ -1,19 +1,19 @@
 <script>
   import DetailsLink from '../components/DetailsLink.svelte';
+  import PageLink from '../components/PageLink.svelte';
+  import {
+    formatPlaceType, osmLink, formatAdminLevel, formatDistance
+  } from '../lib/helpers.js';
 
   export let addressLine;
   export let bDistanceInMeters;
 
   $: bAddressLineUsed = addressLine.isaddress;
 
-  import {
-    formatPlaceType, osmLink, formatAdminLevel, formatDistance
-  } from '../lib/helpers.js';
-
 </script>
 
 <tr class:notused={!bAddressLineUsed}>
-  <td class="name">
+  <td class="name font-weight-bold">
     {#if addressLine.localname}
       {addressLine.localname}
     {:else}
@@ -25,16 +25,21 @@
   <td>{addressLine.rank_address}</td>
   <td>{formatAdminLevel(addressLine.admin_level)}</td>
   <td>{@html formatDistance(addressLine.distance, bDistanceInMeters)}</td>
-  <td>{#if addressLine.osm_id}<DetailsLink feature={addressLine}>details</DetailsLink>{/if}</td>
+  <td>
+    {#if addressLine.osm_id}
+      <DetailsLink feature={addressLine}>details</DetailsLink>
+    {:else if addressLine.type.match(/^country/)}
+      <PageLink page='search', params_hash={{ country: addressLine.localname }}>search by name</PageLink>
+    {:else if addressLine.type === 'postcode'}
+      <PageLink page='search', params_hash={{ postalcode: addressLine.localname }}>search by name</PageLink>
+    {/if}
+  </td>
 </tr>
 
 <style>
   .notused {
     color:#ddd;
   }
-  .name{
-    font-weight: bold;
-  }
   .noname{
     color:#800;
   }
