import React from 'react';
import Sidebar from '../sidebar/Sidebar';
import { useSidebarContext } from '../sidebar/SidebarContext';

const DocumentsLayout = ({ sidebarProps, children }) => {
  const { collapsed } = useSidebarContext();
  return (
    <main className={`documents-main${collapsed ? ' documents-main--sidebar-collapsed' : ''}`}>
      {!collapsed ? <Sidebar {...sidebarProps} /> : null}
      {children}
    </main>
  );
};

export default DocumentsLayout;
