upend/ui/src/components/SearchResult.vue

60 lines
1.1 KiB
Vue
Raw Normal View History

2021-02-21 12:30:33 +01:00
<template>
2021-03-24 21:03:10 +01:00
<router-link
2021-06-19 18:53:43 +02:00
:to="{ name: 'browse', params: { addresses: [result.entity] } }"
2021-03-24 21:03:10 +01:00
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 {
2021-06-19 18:53:43 +02:00
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid var(--foreground);
border-radius: 1rem;
2021-03-24 21:03:10 +01:00
margin: 0.5rem;
2021-02-21 12:30:33 +01:00
padding: 1rem;
2021-06-19 18:53:43 +02:00
width: 100%;
height: 100%;
2021-02-21 12:30:33 +01:00
}
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>