<template>
  <div :class="['information-block', look]">
    <div class="wrapper-cross">
      <slot name="cross"></slot>
    </div>
    <div>
      <div class="icon-block">
        <img
          src="@/assets/images/icon/info-blue.svg"
          alt=""
          class="icon-block-img"
        />
        <h3 v-if="title" class="subtitle">
          {{ title }}
        </h3>
      </div>
      <p v-if="text" v-html="text" class="information-text"></p>
    </div>
    <slot name="button"></slot>
  </div>
</template>

<script setup lang="ts">
defineProps({
  text: { type: String, default: null },
  title: { type: String, default: null },
  look: { type: String, default: '' }
})
</script>

<style scoped lang="scss">
h3 {
  padding: 0;
  margin: 0;
}
.information-block {
  position: relative;
  border-left: toRem(1.4) solid var(--blue);
  padding: toRem(2) toRem(2) toRem(1.5);
  background-color: var(--white);
  border-radius: toRem(1.5);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}
.wrapper-cross {
  position: absolute;
  top: toRem(1);
  right: toRem(1);
}
.blue {
  background-color: var(--blue-pale);
}
.icon-block {
  display: flex;
  align-items: center;
  margin-bottom: toRem(0.5);
}
.icon-block-img {
  margin-right: toRem(0.5);
  height: toRem(2.2);
}
.subtitle {
  @include text(h2);
  color: var(--blue-dark);
}
.information-text {
  margin-top: toRem(1);
  @include text(m-r-regular);
  white-space: pre-wrap;
}
@media (max-width: toRem(50)) {
  .information-block {
    border-left: toRem(1) solid var(--blue);
  }
  .icon-block {
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>
