import React, { useEffect } from 'react';
import { useParams } from 'react-router-dom';
import * as IssuesListStoreNs from './store';
import * as IssuesListBoardsNs from './issues-list-boards';

export const IssuesListBoardPage = (): JSX.Element => {
  const params = useParams();
  const name = params.name as string;
  const type = params.type as string;

  // DEBUG: begin
  console.debug(`Issues list page: type=${type}; name=${name}`);
  useEffect(() => {
    console.debug(`Issues list page: type=${type}; name=${name}`);
  });
  // DEBUG: end

  const store = IssuesListStoreNs.PageStore.create({
    loaded: false,
    type: type,
    name: name,
  });
  IssuesListStoreNs.PageStoreLoadData(store);

  return <IssuesListBoardsNs.IssuesListBoards store={store} />;
};
