<template>
  <div class="maybe-minimized">
    <Minimize :label="name" :minimized="isMinimized" @click="p_minimized = !isMinimized" />
    <div class="content" v-show="isMinimized">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import Minimize from "./PanelButtons/Minimize";
export default {
  components: {
    Minimize,
  },
  data() {
    return {
      p_minimized: null,
    };
  },
  props: {
    minimized: {
      type: Boolean,
      default: true,
    },
    name: {
      type: String
    }
  },
  computed: {
    isMinimized(){
        return this.p_minimized ?? this.minimized;
    },
  },
};
</script>

<style scoped>
.maybe-minimized {
  margin: 0px;
  flex-grow: 1;
}
</style>