<template>
  <div class="node-head">
    <div
      class="node-title"
      :style="{
        fontSize: fontSize + 'px',
        color: color,
        fontWeight: fontWeight,
      }"
      >{{ nodeName }}</div
    >
    <slot></slot>
  </div>
</template>

<script setup lang="ts">
  import { primaryColor } from '../../../../build/config/themeConfig';
  defineProps({
    nodeName: String,
    fontSize: {
      type: Number,
      default: () => {
        return '14px';
      },
    },
    color: {
      type: String,
      default: () => {
        return primaryColor;
      },
    },
    fontWeight: {
      type: String,
      default: () => {
        return 'bold';
      },
    },
  });
</script>

<style scoped lang="less">
  .node-head {
    display: flex;
    align-items: center;
    line-height: 23px;

    &::before {
      width: 4px;
      height: 16px;
      background: @primary-color;
      border-radius: 2px;
      content: '';
    }
  }

  .node-title {
    padding-left: 8px;
  }
</style>
