import { textQuoteIcon } from '@keystar/ui/icon/icons/textQuoteIcon';
import { block } from '@keystatic/core/content-components';
import { fields } from '@keystatic/core';

const blockquoteComponent = {
  Blockquote: block({
    label: 'Blockquote',
    icon: textQuoteIcon,
    schema: {
      quote: fields.text({
        label: 'Quote',
        multiline: true,
        validation: {
          length: {
            min: 1,
          },
        },
      }),
      attribution: fields.text({
        label: 'Attribution',
        description: 'Author or Speaker',
      }),
      source: fields.text({
        label: 'Source',
        description: 'Book, article, or document [optional]',
      }),
      url: fields.url({
        label: 'Source URL',
      }),
    },
  }),
};

export default blockquoteComponent;
