2022-09-25 22:33:13 +00:00
|
|
|
<template>
|
|
|
|
<div class="border-t border-gray-300 px-4 py-5 sm:p-0">
|
|
|
|
<dl class="sm:divide-y sm:divide-gray-300">
|
2023-01-22 06:15:23 +00:00
|
|
|
<div v-for="(detail, i) in details" :key="i" class="py-4 sm:grid group sm:grid-cols-3 sm:gap-4 sm:px-6">
|
2022-10-07 02:54:09 +00:00
|
|
|
<dt class="text-sm font-medium text-base-content">
|
2022-09-25 22:33:13 +00:00
|
|
|
{{ detail.name }}
|
|
|
|
</dt>
|
2023-01-22 06:15:23 +00:00
|
|
|
<dd class="text-sm text-base-content text-start sm:col-span-2">
|
2022-09-25 22:33:13 +00:00
|
|
|
<slot :name="detail.slot || detail.name" v-bind="{ detail }">
|
2023-02-28 04:52:56 +00:00
|
|
|
<DateTime
|
|
|
|
v-if="detail.type == 'date'"
|
|
|
|
:date="detail.text"
|
|
|
|
:datetime-type="detail.date ? 'date' : 'datetime'"
|
|
|
|
/>
|
2022-10-15 20:15:55 +00:00
|
|
|
<Currency v-else-if="detail.type == 'currency'" :amount="detail.text" />
|
2022-10-20 05:31:08 +00:00
|
|
|
<template v-else-if="detail.type === 'link'">
|
|
|
|
<div class="tooltip tooltip-primary tooltip-right" :data-tip="detail.href">
|
|
|
|
<a class="btn btn-primary btn-xs" :href="detail.href" target="_blank">
|
2024-03-01 01:20:18 +00:00
|
|
|
<MdiOpenInNew class="mr-2 swap-on" />
|
2022-10-20 05:31:08 +00:00
|
|
|
{{ detail.text }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-12-03 01:12:32 +00:00
|
|
|
<template v-else-if="detail.type === 'markdown'">
|
|
|
|
<ClientOnly>
|
|
|
|
<Markdown :source="detail.text" />
|
|
|
|
</ClientOnly>
|
|
|
|
</template>
|
2022-09-25 22:33:13 +00:00
|
|
|
<template v-else>
|
2023-01-22 06:15:23 +00:00
|
|
|
<span class="flex items-center">
|
|
|
|
{{ detail.text }}
|
|
|
|
<span
|
|
|
|
v-if="detail.copyable"
|
|
|
|
class="opacity-0 group-hover:opacity-100 ml-4 my-0 duration-75 transition-opacity"
|
|
|
|
>
|
2023-10-07 02:51:08 +00:00
|
|
|
<CopyText
|
|
|
|
v-if="detail.text.toString()"
|
|
|
|
:text="detail.text.toString()"
|
|
|
|
:icon-size="16"
|
|
|
|
class="btn btn-xs btn-ghost btn-circle"
|
|
|
|
/>
|
2023-01-22 06:15:23 +00:00
|
|
|
</span>
|
|
|
|
</span>
|
2022-09-25 22:33:13 +00:00
|
|
|
</template>
|
|
|
|
</slot>
|
|
|
|
</dd>
|
|
|
|
</div>
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2022-12-03 01:12:32 +00:00
|
|
|
import type { AnyDetail, Detail } from "./types";
|
2024-03-01 01:20:18 +00:00
|
|
|
import MdiOpenInNew from "~icons/mdi/open-in-new";
|
2022-09-25 22:33:13 +00:00
|
|
|
|
|
|
|
defineProps({
|
|
|
|
details: {
|
2022-12-03 01:12:32 +00:00
|
|
|
type: Object as () => (Detail | AnyDetail)[],
|
2022-09-25 22:33:13 +00:00
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|