<template>
  <div class="screen-common-component-header" @dblclick="selectComponents">
    {{ title }}
  </div>
</template>

<script lang="ts" setup>
import { useCommonStore } from "@/store";

const commonS = useCommonStore();

const props = defineProps({
  moduleId: {
    type: String,
    required: true,
  },
  title: {
    type: String,
    required: false,
  },
  align: {
    type: String,
    default: "center",
  },
  titleSize: {
    type: String,
    default: "16px",
  },
});

const selectComponents = () => {
  commonS.moduleKey = props.moduleId;
  commonS.isShowSelectModule = true;
};
</script>

<style lang="scss" scoped>
.screen-common-component-header {
  width: 100%;
  display: flex;
  justify-content: v-bind(align);
  align-items: center;
  font-size: v-bind(titleSize);
  color: #fff;
}
</style>
