Skip to content

An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.

930 B
Raw Blame
import { ConfigView } from '@/components/ConfigView';
import TaskDetailsView from '@/components/TaskDetailsView';
import React from 'react';
import { useVSCodeContext } from '../contexts/VSCodeContext';
import { TaskMasterKanban } from './TaskMasterKanban';

export const AppContent: React.FC = () => {
	const { state, dispatch, sendMessage } = useVSCodeContext();

	if (state.currentView === 'config') {
		return (
			<ConfigView
				sendMessage={sendMessage}
				onNavigateBack={() => dispatch({ type: 'NAVIGATE_TO_KANBAN' })}
			/>
		);
	}

	if (state.currentView === 'task-details' && state.selectedTaskId) {
		return (
			<TaskDetailsView
				taskId={state.selectedTaskId}
				onNavigateBack={() => dispatch({ type: 'NAVIGATE_TO_KANBAN' })}
				onNavigateToTask={(taskId: string) =>
					dispatch({ type: 'NAVIGATE_TO_TASK', payload: taskId })
				}
			/>
		);
	}

	// Default to Kanban view
	return <TaskMasterKanban />;
};