import Func from '@/Engine/ECS/Function';
import SysPage from '@/Frameworks/SysPage';
import { PAGE_KEY } from '@/Project/constants';
export enum FuncProjectSelectionState {
  idle,
}

export default class FuncProjectSelection extends Func<FuncProjectSelectionState> {
  constructor(name: string) {
    super(name);
    super.initStates((sm) => {
      sm.addState(
        FuncProjectSelectionState.idle,
        this.onIdleStateIn,
        null,
        this.onIdleStateExit,
      );
    });
  }
  onIdleStateIn(): void {
    const selectProject = (projcet: Api.IProject) => {
      console.log(projcet);
    };
    SysPage.add(PAGE_KEY.ProjectSelection, {
      selectProject,
      subModule: 1,
    });
  }
  onIdleStateExit(): void {
    SysPage.removeByKey(PAGE_KEY.ProjectSelection);
  }
}
