<script setup>
import { CalendarIcon } from "lucide-vue-next";

defineProps({
  options: {
    required: true,
    type: Array,
  },
  modelValue: {
    type: String,
  },
});
</script>

<template>
  <div class="setup-wrapper">
    <div class="content">
      <CalendarIcon class="icon" />
      <span class="title">{{ $t("timetable.setup.title") }}</span>
      <span class="description">{{ $t("timetable.setup.description") }}</span>
      <select
        @input="(event) => $emit('update:modelValue', event.target.value)"
      >
        <option value="none">{{ $t("timetable.setup.prompt") }}</option>
        <option v-for="option in options" :value="option" :key="option">
          {{ option }}
        </option>
      </select>
    </div>
  </div>
</template>

<style scoped>
.setup-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  width: max-content;
  height: max-content;
  max-width: 100%;
  z-index: 1;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: 400px;
  padding: 30px;
}

.icon {
  width: 100px;
  height: 100px;
  stroke-width: 1px;
  padding-bottom: 15px;
}

span {
  word-wrap: normal;
  text-align: center;
}

span.title {
  font-weight: bold;
  font-size: 18px;
}

span.description {
  font-weight: 300;
}

select {
  margin-top: 15px;
  padding: 5px 5px;
  outline: none;
  border: 2px solid var(--element-border-input);
  border-radius: 5px;
  background-color: var(--element-color);
  transition: 0.2s;
  transition-property: background-color border-color;
  color: var(--text-color);
}

select:hover {
  background-color: var(--element-color-hover);
}

select:focus {
  border-color: var(--element-border-focus);
}
</style>
