16 lines
648 B
Vue
16 lines
648 B
Vue
<script setup lang="ts" generic="Row extends { label: string; value?: string; mono?: boolean }">
|
|
/** A list of labelled values: the labels in one column, the values in the other. */
|
|
defineProps<{ rows: Row[] }>();
|
|
</script>
|
|
|
|
<template>
|
|
<dl class="grid grid-cols-[6.5rem_1fr] gap-x-3 gap-y-2 text-xs">
|
|
<template v-for="row in rows" :key="row.label">
|
|
<dt class="leading-5 text-fg-subtle [overflow-wrap:anywhere]">{{ row.label }}</dt>
|
|
<dd class="min-w-0 leading-5 [overflow-wrap:anywhere]" :class="row.mono && 'font-mono'">
|
|
<slot name="value" :row="row">{{ row.value }}</slot>
|
|
</dd>
|
|
</template>
|
|
</dl>
|
|
</template>
|