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

export const createCoverField = () =>
  fields.object(
    {
      src: fields.image({
        label: 'Cover Image',
        directory: 'src/content/articles',
        publicPath: '/content/articles',
      }),
      alt: fields.text({ label: 'Alt Text' }),
      caption: fields.text({ label: 'Caption', multiline: true }),
      showInHeader: fields.checkbox({
        label: 'Show in header',
        defaultValue: false,
      }),
    },
    {
      label: 'Cover Image',
    },
  );
