import {PageProvider, SearchProvider, TableSearchProvider} from '@components';
import {FC} from 'react';
import {
  PRELAOD_KEY,
  context,
  contextState,
  pageContext,
  searchContext,
} from './context';
import Filter from './filter';
import TableList from './table';
import {MODAL_PAGE_SIZE_LIST} from '@utils';

type Props = {
  uuid: string;
};

const InventoryLog: FC<Props> = function ({uuid}) {
  return (
    <TableSearchProvider context={context} state={{...contextState, uuid}}>
      <PageProvider
        context={pageContext}
        initPageSize={MODAL_PAGE_SIZE_LIST[0]}
        preloadKey={PRELAOD_KEY}
      >
        <SearchProvider context={searchContext} preloadKey={PRELAOD_KEY}>
          <section className='content-main'>
            <Filter />
            <TableList />
          </section>
        </SearchProvider>
      </PageProvider>
    </TableSearchProvider>
  );
};

export default InventoryLog;
