<template>
  <router-link
    :to="{ name: 'inspect', params: { address: result.entity } }"
    class="search-result"
  >
    <div class="search-result-container">
      <div class="search-result-attribute">{{ result.attribute }}</div>
      <div class="search-result-value">{{ result.value.c }}</div>
    </div>
  </router-link>
</template>

<script lang="ts">
import { IEntry } from "@/types/base";
import { defineComponent, PropType } from "vue";

export default defineComponent({
  name: "SearchResult",
  props: {
    result: {
      type: Object as PropType<IEntry>,
      required: true,
    },
  },
});
</script>

<style scoped lang="scss">
.search-result {
  .search-result-container {
    box-shadow: var(--sl-shadow-medium);
    margin: 0.5rem;
    padding: 1rem;
  }

  text-align: center;

  color: --foreground;
  text-decoration: inherit;

  div {
    margin: 0.5rem 0;
  }

  .search-result-attribute {
    font-weight: bold;
  }
}
</style>
