import type { QualityComponentDefinition } from '../core/types';

import { QUALITY_ICONS } from '../core/icons';
import { QUALITY_CATEGORY } from '../core/types';

export const spacerDefinition: QualityComponentDefinition = {
  type: 'Spacer',
  name: 'spacer',
  label: '间距',
  category: QUALITY_CATEGORY.BASIC,
  icon: QUALITY_ICONS.spacer,
  aiHint: '纯空白间距，只用来撑开版面，不承载任何内容。',
  defaults: { height: 16 },
  propertySchema: [{ key: 'height', label: '高度(px)', type: 'number', defaultValue: 16 }],
  dataSchema: [],
  buildContent: (properties) => ({
    tagName: 'div',
    style: { height: `${Number(properties.height ?? 16)}px` },
  }),
};