import * as React from 'react'; import { themr, ThemedComponentClass } from '@friendsofreactjs/react-css-themr'; import { PANEL } from '../ThemeIdentifiers'; import * as baseTheme from './Panel.scss'; export interface Props { // If heading needs to be added into panel heading: string | React.ReactNode; // When need to add video into panel video?: React.ReactNode; children?: React.ReactNode; // Theme to be injected via css-themr. theme?: any; // To apply custom styling. componentStyle?: React.CSSProperties; } class Panel extends React.PureComponent { render() { return (
{ typeof this.props.heading === 'string' ?
{this.props.heading}
: this.props.heading }
{this.props.video} {this.props.children}
); } } export default themr(PANEL, baseTheme)(Panel) as ThemedComponentClass;