<script setup>

const props = defineProps({
  gap: {
    type: Boolean,
    default: true
  }
});

</script>

<template>
  <div class="pankow-main-layout-outer">
    <slot name="dialogs"/>
    <div class="pankow-main-layout-container" :class="{ 'gap': gap }">
      <div class="pankow-main-layout-header">
        <slot name="header"/>
      </div>
      <div class="pankow-main-layout-body">
        <slot name="body"/>
      </div>
      <div class="pankow-main-layout-footer">
        <slot name="footer"/>
      </div>
    </div>
  </div>
</template>

<style>

.pankow-main-layout-outer {
  width: 100%;
  height: 100%;
}

.pankow-main-layout-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}

.pankow-main-layout-header {
  flex-shrink: 0;
}

.pankow-main-layout-body {
  width: 100%;
  flex-grow: 1;
  overflow: auto;
  min-height: 2em;
}

.pankow-main-layout-footer {
  flex-shrink: 0;
}

.pankow-main-layout-container.gap > .pankow-main-layout-body {
  padding-top: 10px;
}

</style>