mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-01 03:16:29 +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 () => {
|
||||
if (!userPrompt.trim()) {
|
||||
setPromptError("Prompt cannot be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsCreating(true);
|
||||
try {
|
||||
await createProjectWithOptions({
|
||||
name: defaultName,
|
||||
prompt: userPrompt,
|
||||
prompt: userPrompt.trim(),
|
||||
router,
|
||||
onError: (error) => {
|
||||
console.error('Error creating project:', error);
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
} catch (error) {
|
||||
console.error('Error creating project:', error);
|
||||
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 (
|
||||
<>
|
||||
<input
|
||||
|
|
@ -278,7 +265,8 @@ export function BuildAssistantSection({ defaultName }: BuildAssistantSectionProp
|
|||
<Button
|
||||
variant="primary"
|
||||
size="sm"
|
||||
onClick={handleBuildItMyself}
|
||||
onClick={handleCreateAssistant}
|
||||
isLoading={isCreating}
|
||||
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"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue