import React, { useEffect } from 'react';
import { useParams } from 'react-router-dom';
import * as Stores from './store';
import * as KBS from './kanban-boards';

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

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

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

  return <KBS.KanbanBoards store={store} />;
};
