// WDSidebar.tsx 
import IWDSidebarState from './IWDSidebarState'; 
import IWDSidebarProps from './IWDSidebarProps';
import WDWidgetBase from '@widgets/WDWidgetBase/WDWidgetBase';
import "./WDSidebar.css";
import defaultValue from "./WDSidebarState.json";

export default class WDSidebar extends WDWidgetBase<React.PropsWithChildren<IWDSidebarProps>, IWDSidebarState>{
  
  constructor(props: any) {
    super(props, defaultValue);
    if (this.manualInitState) {
      this.state = {
        ...this.state,
        // Aggiungere qui manualmente la valorizzazione dello stato in base ai valori di props
        header: this.props.header ?? false
      }
    }
  }

  renderContent() {

      let classList = "WDSidebar";
      if (this.state.header) {
        classList += " Header";
      }

       return(
         <div className={classList}>
            {this.props.children}
         </div>
       );
     }
}
