/* eslint-disable react/prop-types */
import React from 'react';
import Shortcode from './Shortcode';
/**
* Slate uses React components to render each type of node that it receives.
* This is the closest thing Slate has to a schema definition. The types are set
* by us when we manually deserialize from Remark's MDAST to Slate's AST.
*/
/**
* Mark Components
*/
const Bold = props => {props.children};
const Italic = props => {props.children};
const Strikethrough = props => {props.children};
const Code = props => {props.children};
/**
* Node Components
*/
const Paragraph = props =>
;
const NumberedList = props => (
{props.children}
);
const Link = props => {
const data = props.node.get('data');
const marks = data.get('marks');
const url = data.get('url');
const title = data.get('title');
const link = (
{props.children}
);
const result = !marks
? link
: marks.reduce((acc, mark) => {
return renderMark({ mark, children: acc });
}, link);
return result;
};
const Image = props => {
const data = props.node.get('data');
const marks = data.get('marks');
const url = data.get('url');
const title = data.get('title');
const alt = data.get('alt');
const image = ;
const result = !marks
? image
: marks.reduce((acc, mark) => {
return renderMark({ mark, children: acc });
}, image);
return result;
};
export const renderMark = props => {
switch (props.mark.type) {
case 'bold':
return ;
case 'italic':
return ;
case 'strikethrough':
return ;
case 'code':
return ;
}
};
export const renderNode = props => {
switch (props.node.type) {
case 'paragraph':
return ;
case 'list-item':
return ;
case 'quote':
return ;
case 'code':
return ;
case 'heading-one':
return ;
case 'heading-two':
return ;
case 'heading-three':
return ;
case 'heading-four':
return ;
case 'heading-five':
return ;
case 'heading-six':
return ;
case 'table':
return
;
case 'table-row':
return ;
case 'table-cell':
return ;
case 'thematic-break':
return ;
case 'bulleted-list':
return ;
case 'numbered-list':
return ;
case 'link':
return ;
case 'image':
return ;
case 'shortcode':
return ;
}
};