<template>
  <div class="info-item">
    <div class="info-item-label">
      {{ props.label }}<template v-if="props.column">：</template>
    </div>
    <div class="info-item-content"><slot></slot></div>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: 'InfoItem',
})

type Props = {
  label: string
  column?: boolean
}

const props = withDefaults(defineProps<Props>(), {
  label: '',
  column: true,
})
</script>

<style scoped lang="less">
.info-item {
  display: flex;
  align-items: flex-start;
  align-items: baseline;
  line-height: 30px;
  &-label {
    color: #888;
    font-size: 14px;
    flex-shrink: 0;
  }
  &-content {
    color: #555;
    font-size: 16px;
    word-break: break-all;
  }
}
</style>
