// import

import styles from './NodeWidget.css';

import React, {Component} from 'react';
import pt from 'prop-types';

import SiteFooterWidget from '../SiteFooterWidget/SiteFooterWidget';
import Node from '../Node/Node';

// component

export default class NodeWidget extends Component {
  static propTypes = {
    node: pt.object,
    nodeProps: pt.object,
    title: pt.string,
  };

  render() {
    const {title, node, nodeProps, ...props} = this.props;

    return (
      <SiteFooterWidget {...props} className={styles.NodeWidget} title={title}>
        <Node banner={{
          stack: 'fill',
          size: 'sidebar',
          allowSplash: true,
        }} header={{
          font: 'body',
          size: 'text',
        }} {...nodeProps} node={node}/>
      </SiteFooterWidget>
    );
  }
}
