<template>
  <div class="flex flex-col w-full">
    <div class="border-l-3 border-l-primary p-2 rounded-t-lg bg-red-200">
      <p class="text-lg font-semibold">Anwendungs Einstellungen</p>
    </div>
    <div class="border-l-3 border-l-primary p-2 rounded-b-lg">
      <div class="w-full">
        <label for="name">Vereins-Name</label>
        <input id="name" type="text" readonly :value="appSettings['app.custom_login_message']" />
      </div>
      <div class="w-full flex flex-row items-center gap-2">
        <div
          v-if="true"
          class="border-2 border-gray-500 rounded-sm"
          :class="appSettings['app.show_link_to_calendar'] ? 'bg-gray-500' : 'h-3 w-3'"
        >
          <CheckIcon v-if="appSettings['app.show_link_to_calendar']" class="h-2.5 w-2.5 stroke-4 text-white" />
        </div>
        <input v-else id="name" type="checkbox" :checked="appSettings['app.show_link_to_calendar']" />
        <label for="name">Kalender-Link anzeigen</label>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useSettingStore } from "@/stores/admin/management/setting";
import { CheckIcon } from "@heroicons/vue/24/outline";
import { mapState } from "pinia";
import { defineComponent } from "vue";
</script>

<script lang="ts">
export default defineComponent({
  computed: {
    ...mapState(useSettingStore, ["readByTopic"]),
    appSettings() {
      return this.readByTopic("app");
    },
  },
});
</script>
