import React, { useEffect } from 'react';
import { useParams } from 'react-router-dom';
import * as KanbanBoardStoreNs from '../kanban-board/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 = KanbanBoardStoreNs.PageStore.create({
    loaded: false,
    type: type,
    name: name,
  });
  KanbanBoardStoreNs.PageStoreLoadData(store);

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