From a4228adf749001fedf7a4d7cab178eb1a5ab6412 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 7 Oct 2025 21:27:15 -0500 Subject: [PATCH] Simplify Act1Dialog --- src/components/Act1Dialog.tsx | 75 +++++++---------------------------- 1 file changed, 14 insertions(+), 61 deletions(-) diff --git a/src/components/Act1Dialog.tsx b/src/components/Act1Dialog.tsx index e31611b7..360028f6 100644 --- a/src/components/Act1Dialog.tsx +++ b/src/components/Act1Dialog.tsx @@ -4,10 +4,8 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/u import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; - -// import { useAISettings } from '@/hooks/useAISettings'; import { useAICredits } from '@/hooks/useAICredits'; -// import { useLocalStorage } from '@/hooks/useLocalStorage'; +import { getShakespeareProvider } from '@/lib/aiProviderPresets'; interface Act1DialogProps { open: boolean; @@ -16,42 +14,12 @@ interface Act1DialogProps { type DialogStep = 'welcome' | 'migration' | 'credits' | 'conclusion'; -const SHAKESPEARE_PROVIDER = { - id: "shakespeare", - baseURL: "https://ai.shakespeare.diy/v1", - nostr: true, -}; - -// const MKSTACK_NSP_ADDR = '31999:4bcaa7b5606e3c14df05cd497e588f5d3fe559b4e9a425e8b418a43af1ffb015:mkstack'; - export function Act1Dialog({ open, onOpenChange }: Act1DialogProps) { const [step, setStep] = useState('welcome'); - // const { setProvider, updateSettings } = useAISettings(); - - // // Get the selectedNSPAddr from localStorage - // const [selectedNSPAddr] = useLocalStorage('selectedNSPAddr', null); - - // Get user's credits - const { data: creditsData } = useAICredits(SHAKESPEARE_PROVIDER); + const { data: creditsData } = useAICredits(getShakespeareProvider()); const handleGetStarted = async () => { try { - // // Add Shakespeare provider to their config - // setProvider(SHAKESPEARE_PROVIDER); - - // // Configure recently used models based on credits or NSP - // const hasCredits = creditsData?.amount && creditsData.amount > 0; - // const hasMKStackNSP = selectedNSPAddr === MKSTACK_NSP_ADDR; - - // if (hasCredits || hasMKStackNSP) { - // // User has credits or MKStack NSP - set to shakespeare model - // updateSettings({ recentlyUsedModels: ['shakespeare/shakespeare'] }); - // } else { - // // No credits - set to tybalt model (free) - // updateSettings({ recentlyUsedModels: ['shakespeare/tybalt'] }); - // } - - // Move to migration step setStep('migration'); } catch (error) { console.error('Failed to configure Shakespeare provider:', error); @@ -269,36 +237,21 @@ export function Act1Dialog({ open, onOpenChange }: Act1DialogProps) { - {creditsData?.amount && creditsData.amount > 0 ? ( -
-
-
- ${creditsData.amount.toFixed(2)} -
-

- Available credits -

-
-
-

- ✅ You're all set! We've configured the premium Shakespeare model for you. -

+
+
+
+ ${(creditsData?.amount ?? 0).toFixed(2)}
+

+ Available credits +

- ) : ( -
-
-
🆓
-

Free Access

-
-
-

- You can continue using Shakespeare for free with the Tybalt model. - It's perfect for learning and building amazing projects! -

-
+
+

+ ✅ You're all set! We've configured the premium Shakespeare model for you. +

- )} +