mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-09 20:52:20 +02:00
show laoding state on create project screen
This commit is contained in:
parent
2f33b41a3c
commit
abbc2f0d2a
1 changed files with 5 additions and 17 deletions
|
|
@ -108,22 +108,18 @@ export function BuildAssistantSection({ defaultName }: BuildAssistantSectionProp
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleCreateAssistant = async () => {
|
const handleCreateAssistant = async () => {
|
||||||
if (!userPrompt.trim()) {
|
|
||||||
setPromptError("Prompt cannot be empty");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsCreating(true);
|
setIsCreating(true);
|
||||||
try {
|
try {
|
||||||
await createProjectWithOptions({
|
await createProjectWithOptions({
|
||||||
name: defaultName,
|
name: defaultName,
|
||||||
prompt: userPrompt,
|
prompt: userPrompt.trim(),
|
||||||
router,
|
router,
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
console.error('Error creating project:', error);
|
console.error('Error creating project:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} finally {
|
} catch (error) {
|
||||||
|
console.error('Error creating project:', error);
|
||||||
setIsCreating(false);
|
setIsCreating(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -171,15 +167,6 @@ export function BuildAssistantSection({ defaultName }: BuildAssistantSectionProp
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle "I'll build it myself" button
|
|
||||||
const handleBuildItMyself = async () => {
|
|
||||||
await createProjectWithOptions({
|
|
||||||
name: defaultName,
|
|
||||||
template: 'default',
|
|
||||||
router
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<input
|
<input
|
||||||
|
|
@ -278,7 +265,8 @@ export function BuildAssistantSection({ defaultName }: BuildAssistantSectionProp
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={handleBuildItMyself}
|
onClick={handleCreateAssistant}
|
||||||
|
isLoading={isCreating}
|
||||||
type="button"
|
type="button"
|
||||||
className="bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"
|
className="bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-600 border border-gray-300 dark:border-gray-600"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue