import { collection, fields } from '@keystatic/core';

import { createArticleField } from '@/keystatic/fields/general/article';
import { wbComponents } from '@/keystatic/components/worldburner';

export default collection({
  label: 'WB – Elements',
  slugField: 'title',
  path: 'content/worldburner/elements/*',
  format: {
    data: 'json',
  },
  columns: ['glyph', 'title', 'category'],
  schema: {
    ...createArticleField('worldburner/elements', 'elements', wbComponents),
    category: fields.select({
      label: 'Category',
      options: [
        {
          label: 'Primal Force',
          value: 'primal-force',
        },
        {
          label: 'Essence',
          value: 'essence',
        },
        {
          label: 'Aspect',
          value: 'aspect',
        },
      ],
      defaultValue: 'primal-force',
    }),
    glyph: fields.text({
      label: 'Glyph',
    }),
  },
});
