<template>
  <div
    class="screen-common-component-header"
    :style="{ fontSize: bigScreenData.fontSize * 2.4 + 'px' }"
    @dblclick="selectComponents"
  >
    {{ title }}
  </div>
</template>

<script lang="ts" setup>
import { useCommonStore } from "@/store";
const bigScreenData: any = inject("bigScreenData");
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>
