Hello from MCP server
<template>
<div class="search-result-item" @click="handleClick">
<div class="result-content">
<h3 class="result-title">{{ title }}</h3>
<p class="result-description" v-html="formattedDescription"></p>
</div>
<ion-button
fill="solid"
color="tertiary"
size="small"
class="details-button"
@click.stop="handleClick"
>
View
</ion-button>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { IonButton } from '@ionic/vue';
const props = defineProps<{
title: string;
description: string;
}>();
const emit = defineEmits<{
click: [];
}>();
const formattedDescription = computed(() => {
if (!props.description) return '';
// Find the first # and style everything from there onwards
const hashIndex = props.description.indexOf('#');
if (hashIndex === -1) return props.description;
const beforeHash = props.description.substring(0, hashIndex);
const afterHash = props.description.substring(hashIndex);
return beforeHash + '<span class="hashtag">' + afterHash + '</span>';
});
const handleClick = () => {
emit('click');
};
</script>
<style scoped>
.search-result-item {
cursor: pointer;
padding: 12px 16px;
border-bottom: 1px solid var(--ion-color-medium);
transition: background-color 0.1s ease;
display: flex;
align-items: center;
gap: 16px;
}
.search-result-item:hover {
background-color: rgba(var(--ion-color-primary-rgb), 0.1);
border-radius: 4px;
}
.search-result-item:last-child {
border-bottom: none;
}
.result-content {
flex: 1;
min-width: 0;
}
.result-title {
margin: 0 0 4px 0;
font-size: 20px;
font-weight: 400;
color: var(--ion-text-color);
line-height: 1.3;
}
.search-result-item:hover .result-title {
text-decoration: underline;
}
.result-description {
margin: 0;
font-size: 14px;
line-height: 1.58;
color: var(--ion-color-medium);
max-width: 600px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.details-button {
--padding-start: 20px;
--padding-end: 20px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
flex-shrink: 0;
}
.result-description :deep(.hashtag) {
color: var(--ion-color-primary);
font-size: 12px;
}
</style>