<template>
  <div class="container" data-weiling-mobile-ui-bc-container>
    <div class="header">
      <slot name="header" />
    </div>
    <div :class="`main ${footerVisible ? 'footerVisible' : ''}`">
      <div class="aside" v-show="isCollapse">
        <slot name="aside" />
      </div>
      <div class="content">
        <slot name="content" />
      </div>
    </div>
    <div class="footer">
      <slot name="footer" />
    </div>
  </div>
</template>

<script lang="ts">
export default {
  name: "BCContainer",
};
</script>

<script lang="ts" setup>
type Props = {
  footerVisible?: boolean;
  isCollapse?: boolean;
}
withDefaults(defineProps<Props>(), {
  footerVisible: false,
  isCollapse: false,
});
</script>

<style lang="scss">
.container[data-weiling-mobile-ui-bc-container] {
  @include container(#fff);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  .main {
    display: flex;
    height: calc(100% - 104px);

    &.footerVisible {
      height: calc(100% - 104px - 76px);
    }

    .aside {
      width: j(90);
    }

    .content {
      height: 100%;
      width: 100%;
      flex: 1;
      overflow: scroll;
    }
  }
}
</style>
