<template>
  <section class="pkg-n-card-panel-wrapper n-radius-md n-overflow-hidden">
    <div class="n-card-panel-header n-px-8 n-py-6 n-bg-primary-5">
      <div
        v-if="!isLoading"
        class="n-flex n-align-center n-justify-between n-gap-2 n-flex-wrap"
      >
        <span class="n-color-main-font n-text-h5 n-font-bold">{{ title }}</span>
        <slot name="headerAction" />
      </div>

      <v-skeleton-loader
        v-else
        loading
        width="300px"
        height="20px"
        type="heading"
      />
    </div>
    <div class="n-p-8">
      <slot />
    </div>
  </section>
</template>

<script>
export default {
  name: "NCardPanel",
  props: {
    title: {
      type: String,
      default: "",
    },
    isLoading: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style scoped>
@import url("./n-card-panel.css");
</style>
