<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">Login-Session Einstellungen</p>
    </div>
    <div class="border-l-3 border-l-primary p-2 rounded-b-lg">
      <div class="w-full">
        <label for="name">JWT-Gültigkeitsdauer</label>
        <input id="name" type="text" readonly :value="sessionSettings['session.jwt_expiration']" />
      </div>
      <div class="w-full">
        <label for="name">Session-Gültigkeitsdauer</label>
        <input id="name" type="text" readonly :value="sessionSettings['session.refresh_expiration']" />
      </div>
      <div class="w-full">
        <label for="name">Sesion-Gültigkeitsdauer PWA</label>
        <input id="name" type="text" readonly :value="sessionSettings['session.pwa_refresh_expiration']" />
      </div>
    </div>
  </div>
</template>

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

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