<script setup lang="ts">
import Fieldset from 'primevue/fieldset';
import { useGeneralStore } from '../stores';

const general = useGeneralStore();

defineProps({
    title: String,
    collapsed: Boolean,
    alwaysFound: Boolean,
});
</script>

<template>
    <Fieldset
        :legend="title"
        :toggleable="true"
        v-show="general.cfgCategories.has(title ?? '') || alwaysFound"
        :collapsed="collapsed"
    >
        <div class="flex w-full flex-col gap-1">
            <slot />
        </div>
    </Fieldset>
</template>
