import type { Block } from 'payload'

export const SkillsBlock: Block = {
  slug: 'skills',
  labels: {
    singular: 'Skills Section',
    plural: 'Skills Sections',
  },
  fields: [
    {
      name: 'heading',
      type: 'text',
      defaultValue: 'what i bring to the table',
    },
    {
      name: 'keySkills',
      type: 'array',
      label: 'Key skills (pills at top)',
      fields: [
        {
          name: 'skill',
          type: 'text',
          required: true,
        },
      ],
    },
    {
      name: 'categories',
      type: 'array',
      label: 'Skill categories',
      fields: [
        {
          name: 'title',
          type: 'text',
          required: true,
        },
        {
          name: 'icon',
          type: 'select',
          label: 'Icon (Tabler icon name)',
          defaultValue: 'ti-layout',
          options: [
            { label: 'Layout', value: 'ti-layout' },
            { label: 'Server', value: 'ti-server' },
            { label: 'Design / Pen', value: 'ti-vector-pen' },
            { label: 'Briefcase', value: 'ti-briefcase' },
            { label: 'Globe', value: 'ti-world' },
            { label: 'Camera', value: 'ti-camera' },
            { label: 'Tools', value: 'ti-tools' },
            { label: 'Sparkles', value: 'ti-sparkles' },
            { label: 'Mobile', value: 'ti-device-mobile' },
            { label: 'Code', value: 'ti-code' },
            { label: 'Chart', value: 'ti-chart-bar' },
            { label: 'Star', value: 'ti-star' },
          ],
        },
        {
          name: 'tags',
          type: 'array',
          fields: [
            {
              name: 'tag',
              type: 'text',
              required: true,
            },
          ],
        },
      ],
    },
  ],
}