import React from "react";
import { Legend } from "./legend";

type TProps = {
    title: string
    date?: string
    content: JSX.Element
    isLegend: boolean
}

export const PlanContentContainer:React.FC<TProps> = React.memo((props) => {
    return <div className="plan-content-container">
        <span className="plan-content-title">{props.title}</span>
        {
            props.date
            ? <span className="plan-content-date">{props.date}</span>
            : null
        }
        <div className="plan-content-content">
            {props.content}
        </div>        
        {
            props.isLegend 
            ? <div className="plan-content-legend">
                <Legend active={true} />
                <Legend active={false} />
            </div>
            : null
        }
    </div>
})