<template>
  <div class="line-info">
    <span class="line-info__bar" />
    <p class="line-info__title">{{ title }}</p>
    <div v-if="numericDesc !== '' || desc" class="line-info__value">
      <span v-if="numericDesc !== ''" class="line-info__numeric">{{ numericDesc }}</span>
      <span v-if="desc" class="line-info__desc">{{ desc }}</span>
    </div>
  </div>
</template>

<script setup>
defineProps({
  title: { type: String, default: '' },
  desc: { type: String, default: '' },
  numericDesc: { type: [String, Number], default: '' },
})
</script>

<style lang="scss" scoped>
.line-info {
  position: relative;
  padding: 0.75rem;
  text-align: start;

  &__bar {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 0;
    transform: translateY(-50%);
    background: #efefef;
    border-radius: 1rem;
    height: 60%;
    min-height: 1.9rem;
    width: 0.25rem;
    right: 0;
  }

  &__title {
    font-family: var(--font-family-fa);
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.5rem;
    color: #b7b7b7;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__value {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.75rem;
  }

  &__numeric {
    font-family: var(--font-family-en);
  }

  &__desc {
    font-family: var(--font-family-fa);
    text-align: justify;
  }
}
</style>
