<template>
  <div v-if="description" class="page-title">
    <h1 class="bold-24px text-title">{{ title }}</h1>
    <p class="page-description">{{ description }}</p>
  </div>
  <div v-else class="page-title no_description">
    <h1 class="bold-24px text-title">{{ title }}</h1>
    <p class="page-description">{{ description }}</p>
  </div>
</template>

<script>
export default {
  name: 'PageTitle',
  data() {
    return {
      title: this.$route.meta.title,
      description: this.$route.meta.description,
    };
  },
};
</script>

<style lang="scss" scoped>
.page-title {
  width: 100%;
  height: 72px;
  border-bottom: 1px solid $faint-secondary-primary-10;
  background-color: $white;
  z-index: 1001;

  display: flex;
  flex-flow: column nowrap;
  align-items: flex-start;
  justify-content: center;
  &.no_description {
    height: 64px;
  }
}

.text-title {
  margin-left: 2rem;
}

.page-description {
  color: $text-secondary;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;

  margin: 4px 0 0 2rem;
  padding: 0;
}
</style>
