<template>
  <MainTemplate>
    <template #topBar>
      <div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
        <h1 class="font-bold text-xl h-8">Einstellungen</h1>
      </div>
    </template>
    <template #main>
      <ClubSetting />
      <AppSetting />
      <MailSetting />
      <SessionSetting />
      <BackupSetting />
    </template>
  </MainTemplate>
</template>

<script setup lang="ts">
import { defineComponent } from "vue";
import { mapState, mapActions } from "pinia";
import MainTemplate from "@/templates/Main.vue";
import { useAbilityStore } from "@/stores/ability";
import { useSettingStore } from "@/stores/admin/management/setting";
import ClubSetting from "@/components/admin/management/setting/ClubSetting.vue";
import AppSetting from "@/components/admin/management/setting/AppSetting.vue";
import MailSetting from "@/components/admin/management/setting/MailSetting.vue";
import SessionSetting from "@/components/admin/management/setting/SessionSetting.vue";
import BackupSetting from "@/components/admin/management/setting/BackupSetting.vue";
</script>

<script lang="ts">
export default defineComponent({
  computed: {
    ...mapState(useAbilityStore, ["can"]),
  },
  mounted() {
    this.fetchSettings();
  },
  methods: {
    ...mapActions(useSettingStore, ["fetchSettings"]),
  },
});
</script>
