mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
more onboarding improvements
This commit is contained in:
1 parent
6fb8e9dbc6
commit
8fd42b9a94
2 files changed
+15
-67
No files matched your search
@@ -22,32 +22,6 @@ export function AISettingsStep({ onNext, onPrevious, onSkip }: AISettingsStepPro
|
||||
onNext();
|
||||
};
|
||||
|
||||
const handleTestConnection = async () => {
|
||||
setIsTesting(true);
|
||||
try {
|
||||
// Basic validation - in a real app, you'd test the API connection
|
||||
if (!localSettings.apiKey.trim()) {
|
||||
throw new Error('API key is required');
|
||||
}
|
||||
if (!localSettings.baseUrl.trim()) {
|
||||
throw new Error('Base URL is required');
|
||||
}
|
||||
if (!localSettings.model.trim()) {
|
||||
throw new Error('Model is required');
|
||||
}
|
||||
|
||||
// Simulate API test
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
||||
// If we get here, save the settings
|
||||
updateSettings(localSettings);
|
||||
} catch (error) {
|
||||
console.error('Failed to test connection:', error);
|
||||
} finally {
|
||||
setIsTesting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const isValid = localSettings.apiKey.trim() && localSettings.baseUrl.trim() && localSettings.model.trim();
|
||||
|
||||
return (
|
||||
@@ -113,32 +87,6 @@ export function AISettingsStep({ onNext, onPrevious, onSkip }: AISettingsStepPro
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isConfigured && (
|
||||
<div className="flex items-center gap-2 text-green-600">
|
||||
<CheckCircle className="h-3 w-3" />
|
||||
<span className="text-xs font-medium">Configured</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
onClick={handleTestConnection}
|
||||
disabled={!isValid || isTesting}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="flex-1 h-8 text-sm"
|
||||
>
|
||||
{isTesting ? (
|
||||
<>
|
||||
<div className="animate-spin rounded-full h-3 w-3 border-b-2 border-current mr-1"></div>
|
||||
Testing...
|
||||
</>
|
||||
) : (
|
||||
'Test & Save'
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ export function ProjectStep({ onPrevious, onComplete, onProjectCreated }: Projec
|
||||
|
||||
<div className="space-y-2">
|
||||
<h3 className="font-medium text-sm">Example prompts:</h3>
|
||||
<ul className="text-sm text-muted-foreground space-y-1">
|
||||
<ul className="text-xs text-muted-foreground space-y-1">
|
||||
<li>• "Build a social media platform for photographers to share their work and connect with clients"</li>
|
||||
<li>• "Create a blog platform with markdown support and Nostr-based comments"</li>
|
||||
<li>• "Design a marketplace for vintage clothing with categories, filters, and user ratings"</li>
|
||||
@@ -79,34 +79,34 @@ export function ProjectStep({ onPrevious, onComplete, onProjectCreated }: Projec
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<div className="flex justify-center gap-3 pt-2">
|
||||
<Button
|
||||
onClick={onPrevious}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-1 h-8 text-sm"
|
||||
>
|
||||
<ArrowLeft className="h-3 w-3" />
|
||||
Back
|
||||
</Button>
|
||||
<div className="flex flex-col items-center gap-2 pt-4">
|
||||
<Button
|
||||
onClick={handleCreateProject}
|
||||
disabled={!prompt.trim() || isCreating}
|
||||
size="sm"
|
||||
className="gap-1 h-8 text-sm bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80"
|
||||
size="lg"
|
||||
className="gap-2 bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80"
|
||||
>
|
||||
{isCreating ? (
|
||||
<>
|
||||
<div className="animate-spin rounded-full h-3 w-3 border-b-2 border-white mr-1"></div>
|
||||
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-1"></div>
|
||||
Creating...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Plus className="h-3 w-3" />
|
||||
<Plus className="h-4 w-4" />
|
||||
Create Project
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={onPrevious}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground text-xs h-7"
|
||||
>
|
||||
<ArrowLeft className="h-3 w-3" />
|
||||
Back
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user