()
| 281 | }; |
| 282 | |
| 283 | const handleCreateProject = async () => { |
| 284 | if (!newProject.name || !newProject.path) return; |
| 285 | |
| 286 | try { |
| 287 | const response = await API.projects.create({ ...newProject, active: false }); |
| 288 | |
| 289 | if (!response.success) { |
| 290 | showError({ |
| 291 | title: 'Failed to Create Project', |
| 292 | error: response.error || 'An error occurred while creating the project.', |
| 293 | details: response.details, |
| 294 | command: response.command |
| 295 | }); |
| 296 | return; |
| 297 | } |
| 298 | |
| 299 | setShowAddProjectDialog(false); |
| 300 | setNewProject({ name: '', path: '', buildScript: '', runScript: '' }); |
| 301 | |
| 302 | // Just reload the projects list |
| 303 | loadProjectsWithSessions(); |
| 304 | } catch (error: unknown) { |
| 305 | console.error('Failed to create project:', error); |
| 306 | showError({ |
| 307 | title: 'Failed to Create Project', |
| 308 | error: error instanceof Error ? error.message : 'An error occurred while creating the project.', |
| 309 | details: error instanceof Error && error.stack ? error.stack : String(error) |
| 310 | }); |
| 311 | } |
| 312 | }; |
| 313 | |
| 314 | if (isLoading) { |
| 315 | return ( |
nothing calls this directly
no test coverage detected