upend/ui/src/components/SearchResult.vue

50 lines
957 B
Vue
Raw Normal View History

2021-02-21 12:30:33 +01:00
<template>
2021-03-24 21:03:10 +01:00
<router-link
:to="{ name: 'inspect', params: { address: result.entity } }"
class="search-result"
>
2021-02-21 12:30:33 +01:00
<div class="search-result-container">
2021-03-15 22:31:18 +01:00
<div class="search-result-attribute">{{ result.attribute }}</div>
2021-02-21 12:30:33 +01:00
<div class="search-result-value">{{ result.value.c }}</div>
</div>
</router-link>
</template>
<script lang="ts">
2021-03-24 21:03:10 +01:00
import { IEntry } from "@/types/base";
import { defineComponent, PropType } from "vue";
2021-02-21 12:30:33 +01:00
export default defineComponent({
name: "SearchResult",
props: {
result: {
type: Object as PropType<IEntry>,
2021-03-24 21:03:10 +01:00
required: true,
},
},
2021-02-21 12:30:33 +01:00
});
</script>
<style scoped lang="scss">
.search-result {
.search-result-container {
box-shadow: var(--sl-shadow-medium);
2021-03-24 21:03:10 +01:00
margin: 0.5rem;
2021-02-21 12:30:33 +01:00
padding: 1rem;
}
text-align: center;
2021-03-18 21:33:40 +01:00
color: --foreground;
2021-02-21 12:30:33 +01:00
text-decoration: inherit;
div {
2021-03-24 21:03:10 +01:00
margin: 0.5rem 0;
2021-02-21 12:30:33 +01:00
}
2021-03-15 22:31:18 +01:00
.search-result-attribute {
2021-02-21 12:30:33 +01:00
font-weight: bold;
}
}
</style>