<template>
  <el-collapse-item :name="panelId" :title="title">
    <template #title>
      <span class="panel-title">{{ title }}</span>
    </template>
    <div class="panel-content">
      <slot></slot>
    </div>
  </el-collapse-item>
</template>

<script>
export default {
  name: 'IntExpansionPanel',
  props: {
    title: {
      type: String,
      default: ''
    },
    expanded: {
      type: Boolean,
      default: false
    },
    panelId: {
      type: [String, Number],
      default() {
        return String(Date.now());
      }
    }
  }
}
</script>

<style scoped>
.int-expansion-panel {
  margin-bottom: 10px;
  border-radius: 4px;
  overflow: hidden;
}

.panel-title {
  font-weight: bold;
  font-size: 14px;
}

.panel-content {
  padding: 10px;
}
</style> 