import { Config } from '@markdoc/markdoc';

export const tags: Config['tags'] = {
  Row: {
    render: 'Row',
    attributes: {
      style: {
        type: 'Object',
        required: true,
      },
    },
  },
  Column: {
    render: 'Column',
    attributes: {
      style: {
        type: 'Object',
        required: true,
      },
    },
  },
  Sidenote: {
    render: 'Sidenote',
    attributes: {
      id: {
        type: 'String',
        required: false,
      },
      marker: {
        type: 'String',
        required: true,
      },
      content: {
        type: 'String',
        required: true,
      },
      type: {
        type: 'String',
        default: 'default',
      },
    },
  },
  DefinitionList: {
    render: 'DefinitionList',
    children: ['tag'],
  },
  DefinitionItem: {
    render: 'DefinitionItem',
    selfClosing: false,
    attributes: {
      term: {
        type: 'String',
        required: true,
      },
      definitions: {
        type: 'Array',
        required: true,
      },
    },
  },
  Accordion: {
    render: 'Accordion',
    children: ['tag'],
  },
  AccordionItem: {
    render: 'AccordionItem',
    attributes: {
      title: {
        type: 'String',
        required: true,
      },
      defaultOpen: {
        type: 'Boolean',
        default: false,
      },
    },
  },
  Blockquote: {
    render: 'Blockquote',
    attributes: {
      quote: {
        type: 'String',
        required: true,
      },
      attribution: {
        type: 'String',
      },
      source: {
        type: 'String',
      },
      url: {
        type: 'String',
      },
    },
  },
  Figure: {
    render: 'Figure',
    attributes: {
      src: {
        type: 'String',
        required: true,
      },
      alt: {
        type: 'String',
        required: true,
      },
      caption: {
        type: 'String',
      },
      credit: {
        type: 'String',
      },
    },
  },
  Callout: {
    render: 'Callout',
    attributes: {
      type: {
        type: 'String',
        default: 'default',
      },
      title: {
        type: 'String',
      },
    },
  },
};
