@digilogiclabs/create-saas-app 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +6 -3
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
- package/dist/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
- package/dist/templates/shared/design/web/src/config/design.config.ts +14 -14
- package/dist/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
- package/dist/templates/shared/security/web/src/lib/api-security.ts +2 -2
- package/dist/templates/web/ai-platform/template/next.config.js +14 -14
- package/dist/templates/web/ai-platform/template/package.json +11 -22
- package/dist/templates/web/ai-platform/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
- package/dist/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
- package/dist/templates/web/ai-platform/template/src/app/error.tsx +13 -13
- package/dist/templates/web/ai-platform/template/src/app/globals.css +97 -34
- package/dist/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +249 -155
- package/dist/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/base/template/next.config.js +14 -15
- package/dist/templates/web/base/template/package.json +16 -31
- package/dist/templates/web/base/template/postcss.config.mjs +8 -0
- package/dist/templates/web/base/template/src/app/error.tsx +97 -97
- package/dist/templates/web/base/template/src/app/globals.css +87 -148
- package/dist/templates/web/base/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/base/template/src/app/loading.tsx +52 -52
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/base/template/tsconfig.json +27 -33
- package/dist/templates/web/iot-dashboard/template/next.config.js +14 -14
- package/dist/templates/web/iot-dashboard/template/package.json +12 -16
- package/dist/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
- package/dist/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
- package/dist/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
- package/dist/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
- package/dist/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
- package/dist/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
- package/dist/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/marketplace/template/next.config.js +14 -14
- package/dist/templates/web/marketplace/template/package.json +11 -18
- package/dist/templates/web/marketplace/template/postcss.config.mjs +8 -0
- package/dist/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
- package/dist/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
- package/dist/templates/web/marketplace/template/src/app/error.tsx +7 -7
- package/dist/templates/web/marketplace/template/src/app/globals.css +97 -20
- package/dist/templates/web/marketplace/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/marketplace/template/src/app/loading.tsx +5 -5
- package/dist/templates/web/marketplace/template/src/app/page.tsx +370 -169
- package/dist/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/dist/templates/web/marketplace/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/micro-saas/template/next.config.js +14 -14
- package/dist/templates/web/micro-saas/template/package.json +9 -8
- package/dist/templates/web/micro-saas/template/postcss.config.mjs +8 -0
- package/dist/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
- package/dist/templates/web/micro-saas/template/src/app/error.tsx +7 -7
- package/dist/templates/web/micro-saas/template/src/app/globals.css +97 -20
- package/dist/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
- package/dist/templates/web/micro-saas/template/src/app/login/page.tsx +101 -87
- package/dist/templates/web/micro-saas/template/src/app/page.tsx +227 -137
- package/dist/templates/web/micro-saas/template/src/app/signup/page.tsx +122 -108
- package/dist/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- package/dist/templates/web/ui-auth/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth/template/package.json +16 -26
- package/dist/templates/web/ui-auth/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth/template/src/app/globals.css +85 -84
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ui-auth/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-ai/template/next.config.js +15 -13
- package/dist/templates/web/ui-auth-ai/template/package.json +25 -21
- package/dist/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
- package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
- package/dist/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
- package/dist/templates/web/ui-auth-payments/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments/template/package.json +16 -29
- package/dist/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-ai/template/package.json +17 -33
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +17 -30
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
- package/dist/templates/web/ui-auth-payments-video/template/package.json +17 -30
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +5 -2
- package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
- package/dist/templates/web/ui-only/template/next.config.js +14 -12
- package/dist/templates/web/ui-only/template/package.json +15 -25
- package/dist/templates/web/ui-only/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -67
- package/dist/templates/web/ui-only/template/src/app/globals.css +85 -31
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +4 -1
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -20
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +20 -26
- package/dist/templates/web/ui-only/template/tsconfig.json +27 -33
- package/package.json +1 -1
- package/src/templates/shared/auth/supabase/web/src/middleware.ts +63 -0
- package/src/templates/shared/database/supabase/web/src/lib/supabase/server.ts +3 -1
- package/src/templates/shared/design/web/src/config/design.config.ts +14 -14
- package/src/templates/shared/landing/web/src/components/LandingPage.tsx +0 -3
- package/src/templates/shared/security/web/src/lib/api-security.ts +2 -2
- package/src/templates/web/ai-platform/template/next.config.js +14 -14
- package/src/templates/web/ai-platform/template/package.json +11 -22
- package/src/templates/web/ai-platform/template/postcss.config.mjs +8 -0
- package/src/templates/web/ai-platform/template/src/app/chat/page.tsx +234 -235
- package/src/templates/web/ai-platform/template/src/app/dashboard/page.tsx +142 -142
- package/src/templates/web/ai-platform/template/src/app/error.tsx +13 -13
- package/src/templates/web/ai-platform/template/src/app/globals.css +97 -34
- package/src/templates/web/ai-platform/template/src/app/layout.tsx +3 -0
- package/src/templates/web/ai-platform/template/src/app/loading.tsx +22 -22
- package/src/templates/web/ai-platform/template/src/app/page.tsx +249 -155
- package/src/templates/web/ai-platform/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ai-platform/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/base/template/next.config.js +14 -15
- package/src/templates/web/base/template/package.json +16 -31
- package/src/templates/web/base/template/postcss.config.mjs +8 -0
- package/src/templates/web/base/template/src/app/error.tsx +97 -97
- package/src/templates/web/base/template/src/app/globals.css +87 -148
- package/src/templates/web/base/template/src/app/layout.tsx +4 -1
- package/src/templates/web/base/template/src/app/loading.tsx +52 -52
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/base/template/tsconfig.json +27 -33
- package/src/templates/web/iot-dashboard/template/next.config.js +14 -14
- package/src/templates/web/iot-dashboard/template/package.json +12 -16
- package/src/templates/web/iot-dashboard/template/postcss.config.mjs +8 -0
- package/src/templates/web/iot-dashboard/template/src/app/dashboard/page.tsx +224 -224
- package/src/templates/web/iot-dashboard/template/src/app/error.tsx +8 -8
- package/src/templates/web/iot-dashboard/template/src/app/globals.css +97 -20
- package/src/templates/web/iot-dashboard/template/src/app/layout.tsx +3 -0
- package/src/templates/web/iot-dashboard/template/src/app/loading.tsx +5 -5
- package/src/templates/web/iot-dashboard/template/src/app/page.tsx +266 -189
- package/src/templates/web/iot-dashboard/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/iot-dashboard/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/marketplace/template/next.config.js +14 -14
- package/src/templates/web/marketplace/template/package.json +11 -18
- package/src/templates/web/marketplace/template/postcss.config.mjs +8 -0
- package/src/templates/web/marketplace/template/src/app/cart/page.tsx +147 -147
- package/src/templates/web/marketplace/template/src/app/dashboard/page.tsx +149 -149
- package/src/templates/web/marketplace/template/src/app/error.tsx +7 -7
- package/src/templates/web/marketplace/template/src/app/globals.css +97 -20
- package/src/templates/web/marketplace/template/src/app/layout.tsx +3 -0
- package/src/templates/web/marketplace/template/src/app/loading.tsx +5 -5
- package/src/templates/web/marketplace/template/src/app/page.tsx +370 -169
- package/src/templates/web/marketplace/template/src/app/products/page.tsx +129 -129
- package/src/templates/web/marketplace/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/marketplace/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/micro-saas/template/next.config.js +14 -14
- package/src/templates/web/micro-saas/template/package.json +9 -8
- package/src/templates/web/micro-saas/template/postcss.config.mjs +8 -0
- package/src/templates/web/micro-saas/template/src/app/dashboard/page.tsx +145 -117
- package/src/templates/web/micro-saas/template/src/app/error.tsx +7 -7
- package/src/templates/web/micro-saas/template/src/app/globals.css +97 -20
- package/src/templates/web/micro-saas/template/src/app/layout.tsx +3 -0
- package/src/templates/web/micro-saas/template/src/app/loading.tsx +43 -27
- package/src/templates/web/micro-saas/template/src/app/login/page.tsx +101 -87
- package/src/templates/web/micro-saas/template/src/app/page.tsx +227 -137
- package/src/templates/web/micro-saas/template/src/app/signup/page.tsx +122 -108
- package/src/templates/web/micro-saas/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/micro-saas/template/src/lib/auth-server.ts +32 -33
- package/src/templates/web/ui-auth/template/next.config.js +14 -12
- package/src/templates/web/ui-auth/template/package.json +16 -26
- package/src/templates/web/ui-auth/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth/template/src/app/globals.css +85 -84
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth/template/src/app/loading.tsx +20 -38
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ui-auth/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-ai/template/next.config.js +15 -13
- package/src/templates/web/ui-auth-ai/template/package.json +25 -21
- package/src/templates/web/ui-auth-ai/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-ai/template/src/app/error.tsx +7 -7
- package/src/templates/web/ui-auth-ai/template/src/app/globals.css +87 -25
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +3 -0
- package/src/templates/web/ui-auth-ai/template/src/app/loading.tsx +4 -4
- package/src/templates/web/ui-auth-ai/template/tsconfig.json +27 -28
- package/src/templates/web/ui-auth-payments/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments/template/package.json +16 -29
- package/src/templates/web/ui-auth-payments/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +89 -204
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-ai/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-ai/template/package.json +17 -33
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-ai/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-ai/template/src/app/globals.css +85 -85
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-audio/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-audio/template/package.json +17 -30
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-audio/template/src/app/globals.css +85 -85
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.json +27 -33
- package/src/templates/web/ui-auth-payments-video/template/next.config.js +14 -12
- package/src/templates/web/ui-auth-payments-video/template/package.json +17 -30
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +89 -221
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +5 -2
- package/src/templates/web/ui-auth-payments-video/template/tsconfig.json +27 -33
- package/src/templates/web/ui-only/template/next.config.js +14 -12
- package/src/templates/web/ui-only/template/package.json +15 -25
- package/src/templates/web/ui-only/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-only/template/src/app/error.tsx +67 -67
- package/src/templates/web/ui-only/template/src/app/globals.css +85 -31
- package/src/templates/web/ui-only/template/src/app/layout.tsx +4 -1
- package/src/templates/web/ui-only/template/src/app/loading.tsx +20 -20
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +20 -26
- package/src/templates/web/ui-only/template/tsconfig.json +27 -33
- package/dist/templates/web/ai-platform/template/middleware.ts +0 -55
- package/dist/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/base/template/postcss.config.js +0 -7
- package/dist/templates/web/base/template/tailwind.config.js +0 -77
- package/dist/templates/web/iot-dashboard/template/middleware.ts +0 -56
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/marketplace/template/middleware.ts +0 -56
- package/dist/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
- package/dist/templates/web/micro-saas/template/middleware.ts +0 -53
- package/dist/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
- package/dist/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
- package/dist/templates/web/ui-auth/template/.claude +0 -21
- package/dist/templates/web/ui-auth/template/context.md +0 -105
- package/dist/templates/web/ui-auth/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
- package/dist/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
- package/dist/templates/web/ui-auth-payments/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-ai/template/.claude +0 -21
- package/dist/templates/web/ui-auth-payments-ai/template/context.md +0 -169
- package/dist/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
- package/dist/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
- package/dist/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-only/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-only/template/tailwind.config.js +0 -77
- package/src/templates/web/ai-platform/template/middleware.ts +0 -55
- package/src/templates/web/ai-platform/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/ai-platform/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/base/template/postcss.config.js +0 -7
- package/src/templates/web/base/template/tailwind.config.js +0 -77
- package/src/templates/web/iot-dashboard/template/middleware.ts +0 -56
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/iot-dashboard/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/marketplace/template/middleware.ts +0 -56
- package/src/templates/web/marketplace/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/marketplace/template/src/lib/supabase/server.ts +0 -27
- package/src/templates/web/micro-saas/template/middleware.ts +0 -53
- package/src/templates/web/micro-saas/template/src/lib/supabase/client.ts +0 -8
- package/src/templates/web/micro-saas/template/src/lib/supabase/server.ts +0 -29
- package/src/templates/web/ui-auth/template/.claude +0 -21
- package/src/templates/web/ui-auth/template/context.md +0 -105
- package/src/templates/web/ui-auth/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-ai/template/postcss.config.js +0 -6
- package/src/templates/web/ui-auth-ai/template/tailwind.config.js +0 -22
- package/src/templates/web/ui-auth-payments/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments/template/package-lock.json +0 -12240
- package/src/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-ai/template/.claude +0 -21
- package/src/templates/web/ui-auth-payments-ai/template/context.md +0 -169
- package/src/templates/web/ui-auth-payments-ai/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments-ai/template/package-lock.json +0 -12241
- package/src/templates/web/ui-auth-payments-ai/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-ai/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments-ai/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-audio/template/middleware.ts +0 -68
- package/src/templates/web/ui-auth-payments-audio/template/package-lock.json +0 -12241
- package/src/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +0 -1
- package/src/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
- package/src/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
- package/src/templates/web/ui-only/template/postcss.config.js +0 -7
- package/src/templates/web/ui-only/template/tailwind.config.js +0 -77
- /package/dist/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
- /package/dist/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
- /package/dist/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
- /package/dist/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
- /package/src/templates/shared/admin/web/{components → src/components}/admin-nav.tsx +0 -0
- /package/src/templates/shared/auth/keycloak/web/{auth.config.ts → src/auth.config.ts} +0 -0
- /package/src/templates/shared/auth/keycloak/web/{auth.ts → src/auth.ts} +0 -0
- /package/src/templates/shared/middleware/web/{middleware.ts → src/middleware.ts} +0 -0
|
@@ -1,235 +1,234 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useState, useRef, useEffect } from 'react'
|
|
4
|
-
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
-
import { Send, Bot, User, Loader2, Sparkles } from 'lucide-react'
|
|
6
|
-
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
7
|
-
import Link from 'next/link'
|
|
8
|
-
|
|
9
|
-
interface Message {
|
|
10
|
-
id: string
|
|
11
|
-
role: 'user' | 'assistant'
|
|
12
|
-
content: string
|
|
13
|
-
timestamp: Date
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const MODELS = [
|
|
17
|
-
{ id: 'gpt-4o', name: 'GPT-4o', provider: 'OpenAI' },
|
|
18
|
-
{ id: 'claude-3-5-sonnet', name: 'Claude 3.5 Sonnet', provider: 'Anthropic' },
|
|
19
|
-
{ id: 'gpt-4o-mini', name: 'GPT-4o Mini', provider: 'OpenAI' },
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
export default function ChatPage() {
|
|
23
|
-
const { user, loading: authLoading } = useAuth()
|
|
24
|
-
const [messages, setMessages] = useState<Message[]>([])
|
|
25
|
-
const [input, setInput] = useState('')
|
|
26
|
-
const [isLoading, setIsLoading] = useState(false)
|
|
27
|
-
const [selectedModel, setSelectedModel] = useState(MODELS[0].id)
|
|
28
|
-
const messagesEndRef = useRef<HTMLDivElement>(null)
|
|
29
|
-
|
|
30
|
-
const scrollToBottom = () => {
|
|
31
|
-
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' })
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
scrollToBottom()
|
|
36
|
-
}, [messages])
|
|
37
|
-
|
|
38
|
-
const handleSubmit = async (e: React.FormEvent) => {
|
|
39
|
-
e.preventDefault()
|
|
40
|
-
if (!input.trim() || isLoading) return
|
|
41
|
-
|
|
42
|
-
const userMessage: Message = {
|
|
43
|
-
id: Date.now().toString(),
|
|
44
|
-
role: 'user',
|
|
45
|
-
content: input,
|
|
46
|
-
timestamp: new Date(),
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
setMessages(prev => [...prev, userMessage])
|
|
50
|
-
setInput('')
|
|
51
|
-
setIsLoading(true)
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const response = await fetch('/api/chat', {
|
|
55
|
-
method: 'POST',
|
|
56
|
-
headers: { 'Content-Type': 'application/json' },
|
|
57
|
-
body: JSON.stringify({
|
|
58
|
-
messages: [...messages, userMessage].map(m => ({
|
|
59
|
-
role: m.role,
|
|
60
|
-
content: m.content,
|
|
61
|
-
})),
|
|
62
|
-
model: selectedModel,
|
|
63
|
-
}),
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const data = await response.json()
|
|
67
|
-
|
|
68
|
-
const assistantMessage: Message = {
|
|
69
|
-
id: (Date.now() + 1).toString(),
|
|
70
|
-
role: 'assistant',
|
|
71
|
-
content: data.content || 'Sorry, I could not process your request.',
|
|
72
|
-
timestamp: new Date(),
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
setMessages(prev => [...prev, assistantMessage])
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error('Chat error:', error)
|
|
78
|
-
const errorMessage: Message = {
|
|
79
|
-
id: (Date.now() + 1).toString(),
|
|
80
|
-
role: 'assistant',
|
|
81
|
-
content: 'Sorry, there was an error processing your request. Please try again.',
|
|
82
|
-
timestamp: new Date(),
|
|
83
|
-
}
|
|
84
|
-
setMessages(prev => [...prev, errorMessage])
|
|
85
|
-
} finally {
|
|
86
|
-
setIsLoading(false)
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (authLoading) {
|
|
91
|
-
return (
|
|
92
|
-
<div className="min-h-screen bg-
|
|
93
|
-
<Loader2 className="w-8 h-8 text-
|
|
94
|
-
</div>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (!user) {
|
|
99
|
-
return (
|
|
100
|
-
<div className="min-h-screen bg-
|
|
101
|
-
<Card className="p-8 bg-
|
|
102
|
-
<Bot className="w-16 h-16 text-
|
|
103
|
-
<h2 className="text-2xl font-bold text-
|
|
104
|
-
<p className="text-
|
|
105
|
-
Create an account to start chatting with AI models.
|
|
106
|
-
</p>
|
|
107
|
-
<div className="flex gap-2 justify-center">
|
|
108
|
-
<Link href="/login">
|
|
109
|
-
<Button variant="outline"
|
|
110
|
-
</Link>
|
|
111
|
-
<Link href="/signup">
|
|
112
|
-
<Button
|
|
113
|
-
</Link>
|
|
114
|
-
</div>
|
|
115
|
-
</Card>
|
|
116
|
-
</div>
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<div className="h-screen bg-
|
|
122
|
-
{/* Header */}
|
|
123
|
-
<header className="border-b border-
|
|
124
|
-
<div className="max-w-4xl mx-auto flex items-center justify-between">
|
|
125
|
-
<div className="flex items-center gap-2">
|
|
126
|
-
<Link href="/" className="flex items-center gap-2 text-
|
|
127
|
-
<Bot className="w-6 h-6 text-
|
|
128
|
-
<span className="font-bold">AI Chat</span>
|
|
129
|
-
</Link>
|
|
130
|
-
</div>
|
|
131
|
-
<select
|
|
132
|
-
value={selectedModel}
|
|
133
|
-
onChange={(e) => setSelectedModel(e.target.value)}
|
|
134
|
-
className="bg-
|
|
135
|
-
>
|
|
136
|
-
{MODELS.map((model) => (
|
|
137
|
-
<option key={model.id} value={model.id} className="bg-
|
|
138
|
-
{model.name}
|
|
139
|
-
</option>
|
|
140
|
-
))}
|
|
141
|
-
</select>
|
|
142
|
-
</div>
|
|
143
|
-
</header>
|
|
144
|
-
|
|
145
|
-
{/* Messages */}
|
|
146
|
-
<div className="flex-1 overflow-y-auto px-4 py-6">
|
|
147
|
-
<div className="max-w-4xl mx-auto space-y-6">
|
|
148
|
-
{messages.length === 0 && (
|
|
149
|
-
<div className="text-center py-20">
|
|
150
|
-
<Sparkles className="w-16 h-16 text-
|
|
151
|
-
<h2 className="text-2xl font-bold text-
|
|
152
|
-
<p className="text-
|
|
153
|
-
<div className="flex flex-wrap gap-2 justify-center mt-4">
|
|
154
|
-
{['Explain quantum computing', 'Write a Python function', 'Help me brainstorm'].map((prompt) => (
|
|
155
|
-
<button
|
|
156
|
-
key={prompt}
|
|
157
|
-
onClick={() => setInput(prompt)}
|
|
158
|
-
className="px-4 py-2 bg-
|
|
159
|
-
>
|
|
160
|
-
{prompt}
|
|
161
|
-
</button>
|
|
162
|
-
))}
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
)}
|
|
166
|
-
|
|
167
|
-
{messages.map((message) => (
|
|
168
|
-
<div
|
|
169
|
-
key={message.id}
|
|
170
|
-
className={`flex gap-4 ${message.role === 'user' ? 'justify-end' : ''}`}
|
|
171
|
-
>
|
|
172
|
-
{message.role === 'assistant' && (
|
|
173
|
-
<div className="w-8 h-8 rounded-lg bg-
|
|
174
|
-
<Bot className="w-5 h-5 text-
|
|
175
|
-
</div>
|
|
176
|
-
)}
|
|
177
|
-
<div
|
|
178
|
-
className={`max-w-2xl rounded-lg px-4 py-3 ${
|
|
179
|
-
message.role === 'user'
|
|
180
|
-
? 'bg-
|
|
181
|
-
: 'bg-
|
|
182
|
-
}`}
|
|
183
|
-
>
|
|
184
|
-
<p className="whitespace-pre-wrap">{message.content}</p>
|
|
185
|
-
</div>
|
|
186
|
-
{message.role === 'user' && (
|
|
187
|
-
<div className="w-8 h-8 rounded-lg bg-
|
|
188
|
-
<User className="w-5 h-5 text-
|
|
189
|
-
</div>
|
|
190
|
-
)}
|
|
191
|
-
</div>
|
|
192
|
-
))}
|
|
193
|
-
|
|
194
|
-
{isLoading && (
|
|
195
|
-
<div className="flex gap-4">
|
|
196
|
-
<div className="w-8 h-8 rounded-lg bg-
|
|
197
|
-
<Bot className="w-5 h-5 text-
|
|
198
|
-
</div>
|
|
199
|
-
<div className="bg-
|
|
200
|
-
<Loader2 className="w-5 h-5 text-
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
)}
|
|
204
|
-
|
|
205
|
-
<div ref={messagesEndRef} />
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
{/* Input */}
|
|
210
|
-
<div className="border-t border-
|
|
211
|
-
<form onSubmit={handleSubmit} className="max-w-4xl mx-auto flex gap-2">
|
|
212
|
-
<input
|
|
213
|
-
type="text"
|
|
214
|
-
value={input}
|
|
215
|
-
onChange={(e) => setInput(e.target.value)}
|
|
216
|
-
placeholder="Type your message..."
|
|
217
|
-
className="flex-1 bg-
|
|
218
|
-
disabled={isLoading}
|
|
219
|
-
/>
|
|
220
|
-
<Button
|
|
221
|
-
type="submit"
|
|
222
|
-
disabled={!input.trim() || isLoading}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState, useRef, useEffect } from 'react'
|
|
4
|
+
import { Button, Card } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { Send, Bot, User, Loader2, Sparkles } from 'lucide-react'
|
|
6
|
+
import { useAuth } from '@digilogiclabs/app-sdk'
|
|
7
|
+
import Link from 'next/link'
|
|
8
|
+
|
|
9
|
+
interface Message {
|
|
10
|
+
id: string
|
|
11
|
+
role: 'user' | 'assistant'
|
|
12
|
+
content: string
|
|
13
|
+
timestamp: Date
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const MODELS = [
|
|
17
|
+
{ id: 'gpt-4o', name: 'GPT-4o', provider: 'OpenAI' },
|
|
18
|
+
{ id: 'claude-3-5-sonnet', name: 'Claude 3.5 Sonnet', provider: 'Anthropic' },
|
|
19
|
+
{ id: 'gpt-4o-mini', name: 'GPT-4o Mini', provider: 'OpenAI' },
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
export default function ChatPage() {
|
|
23
|
+
const { user, loading: authLoading } = useAuth()
|
|
24
|
+
const [messages, setMessages] = useState<Message[]>([])
|
|
25
|
+
const [input, setInput] = useState('')
|
|
26
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
27
|
+
const [selectedModel, setSelectedModel] = useState(MODELS[0].id)
|
|
28
|
+
const messagesEndRef = useRef<HTMLDivElement>(null)
|
|
29
|
+
|
|
30
|
+
const scrollToBottom = () => {
|
|
31
|
+
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
scrollToBottom()
|
|
36
|
+
}, [messages])
|
|
37
|
+
|
|
38
|
+
const handleSubmit = async (e: React.FormEvent) => {
|
|
39
|
+
e.preventDefault()
|
|
40
|
+
if (!input.trim() || isLoading) return
|
|
41
|
+
|
|
42
|
+
const userMessage: Message = {
|
|
43
|
+
id: Date.now().toString(),
|
|
44
|
+
role: 'user',
|
|
45
|
+
content: input,
|
|
46
|
+
timestamp: new Date(),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setMessages(prev => [...prev, userMessage])
|
|
50
|
+
setInput('')
|
|
51
|
+
setIsLoading(true)
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
const response = await fetch('/api/chat', {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
headers: { 'Content-Type': 'application/json' },
|
|
57
|
+
body: JSON.stringify({
|
|
58
|
+
messages: [...messages, userMessage].map(m => ({
|
|
59
|
+
role: m.role,
|
|
60
|
+
content: m.content,
|
|
61
|
+
})),
|
|
62
|
+
model: selectedModel,
|
|
63
|
+
}),
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const data = await response.json()
|
|
67
|
+
|
|
68
|
+
const assistantMessage: Message = {
|
|
69
|
+
id: (Date.now() + 1).toString(),
|
|
70
|
+
role: 'assistant',
|
|
71
|
+
content: data.content || 'Sorry, I could not process your request.',
|
|
72
|
+
timestamp: new Date(),
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
setMessages(prev => [...prev, assistantMessage])
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('Chat error:', error)
|
|
78
|
+
const errorMessage: Message = {
|
|
79
|
+
id: (Date.now() + 1).toString(),
|
|
80
|
+
role: 'assistant',
|
|
81
|
+
content: 'Sorry, there was an error processing your request. Please try again.',
|
|
82
|
+
timestamp: new Date(),
|
|
83
|
+
}
|
|
84
|
+
setMessages(prev => [...prev, errorMessage])
|
|
85
|
+
} finally {
|
|
86
|
+
setIsLoading(false)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (authLoading) {
|
|
91
|
+
return (
|
|
92
|
+
<div className="min-h-screen bg-background flex items-center justify-center">
|
|
93
|
+
<Loader2 className="w-8 h-8 text-primary animate-spin" />
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!user) {
|
|
99
|
+
return (
|
|
100
|
+
<div className="min-h-screen bg-background flex items-center justify-center">
|
|
101
|
+
<Card className="p-8 bg-secondary border-border text-center max-w-md">
|
|
102
|
+
<Bot className="w-16 h-16 text-primary mx-auto mb-4" />
|
|
103
|
+
<h2 className="text-2xl font-bold text-foreground mb-2">Sign in to Chat</h2>
|
|
104
|
+
<p className="text-muted-foreground mb-6">
|
|
105
|
+
Create an account to start chatting with AI models.
|
|
106
|
+
</p>
|
|
107
|
+
<div className="flex gap-2 justify-center">
|
|
108
|
+
<Link href="/login">
|
|
109
|
+
<Button variant="outline">Sign In</Button>
|
|
110
|
+
</Link>
|
|
111
|
+
<Link href="/signup">
|
|
112
|
+
<Button>Sign Up</Button>
|
|
113
|
+
</Link>
|
|
114
|
+
</div>
|
|
115
|
+
</Card>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<div className="h-screen bg-background flex flex-col">
|
|
122
|
+
{/* Header */}
|
|
123
|
+
<header className="border-b border-border bg-card/50 px-4 py-3">
|
|
124
|
+
<div className="max-w-4xl mx-auto flex items-center justify-between">
|
|
125
|
+
<div className="flex items-center gap-2">
|
|
126
|
+
<Link href="/" className="flex items-center gap-2 text-foreground">
|
|
127
|
+
<Bot className="w-6 h-6 text-primary" />
|
|
128
|
+
<span className="font-bold">AI Chat</span>
|
|
129
|
+
</Link>
|
|
130
|
+
</div>
|
|
131
|
+
<select
|
|
132
|
+
value={selectedModel}
|
|
133
|
+
onChange={(e) => setSelectedModel(e.target.value)}
|
|
134
|
+
className="bg-secondary border border-border rounded-lg px-3 py-1.5 text-foreground text-sm focus:ring-2 focus:ring-ring"
|
|
135
|
+
>
|
|
136
|
+
{MODELS.map((model) => (
|
|
137
|
+
<option key={model.id} value={model.id} className="bg-card">
|
|
138
|
+
{model.name}
|
|
139
|
+
</option>
|
|
140
|
+
))}
|
|
141
|
+
</select>
|
|
142
|
+
</div>
|
|
143
|
+
</header>
|
|
144
|
+
|
|
145
|
+
{/* Messages */}
|
|
146
|
+
<div className="flex-1 overflow-y-auto px-4 py-6">
|
|
147
|
+
<div className="max-w-4xl mx-auto space-y-6">
|
|
148
|
+
{messages.length === 0 && (
|
|
149
|
+
<div className="text-center py-20">
|
|
150
|
+
<Sparkles className="w-16 h-16 text-primary mx-auto mb-4" />
|
|
151
|
+
<h2 className="text-2xl font-bold text-foreground mb-2">Start a Conversation</h2>
|
|
152
|
+
<p className="text-muted-foreground">Ask me anything or try one of these prompts:</p>
|
|
153
|
+
<div className="flex flex-wrap gap-2 justify-center mt-4">
|
|
154
|
+
{['Explain quantum computing', 'Write a Python function', 'Help me brainstorm'].map((prompt) => (
|
|
155
|
+
<button
|
|
156
|
+
key={prompt}
|
|
157
|
+
onClick={() => setInput(prompt)}
|
|
158
|
+
className="px-4 py-2 bg-secondary border border-border rounded-lg text-muted-foreground hover:bg-accent transition text-sm"
|
|
159
|
+
>
|
|
160
|
+
{prompt}
|
|
161
|
+
</button>
|
|
162
|
+
))}
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
|
|
167
|
+
{messages.map((message) => (
|
|
168
|
+
<div
|
|
169
|
+
key={message.id}
|
|
170
|
+
className={`flex gap-4 ${message.role === 'user' ? 'justify-end' : ''}`}
|
|
171
|
+
>
|
|
172
|
+
{message.role === 'assistant' && (
|
|
173
|
+
<div className="w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0">
|
|
174
|
+
<Bot className="w-5 h-5 text-primary" />
|
|
175
|
+
</div>
|
|
176
|
+
)}
|
|
177
|
+
<div
|
|
178
|
+
className={`max-w-2xl rounded-lg px-4 py-3 ${
|
|
179
|
+
message.role === 'user'
|
|
180
|
+
? 'bg-primary text-primary-foreground'
|
|
181
|
+
: 'bg-secondary text-foreground'
|
|
182
|
+
}`}
|
|
183
|
+
>
|
|
184
|
+
<p className="whitespace-pre-wrap">{message.content}</p>
|
|
185
|
+
</div>
|
|
186
|
+
{message.role === 'user' && (
|
|
187
|
+
<div className="w-8 h-8 rounded-lg bg-accent flex items-center justify-center flex-shrink-0">
|
|
188
|
+
<User className="w-5 h-5 text-accent-foreground" />
|
|
189
|
+
</div>
|
|
190
|
+
)}
|
|
191
|
+
</div>
|
|
192
|
+
))}
|
|
193
|
+
|
|
194
|
+
{isLoading && (
|
|
195
|
+
<div className="flex gap-4">
|
|
196
|
+
<div className="w-8 h-8 rounded-lg bg-primary/20 flex items-center justify-center">
|
|
197
|
+
<Bot className="w-5 h-5 text-primary" />
|
|
198
|
+
</div>
|
|
199
|
+
<div className="bg-secondary rounded-lg px-4 py-3">
|
|
200
|
+
<Loader2 className="w-5 h-5 text-primary animate-spin" />
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
)}
|
|
204
|
+
|
|
205
|
+
<div ref={messagesEndRef} />
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
{/* Input */}
|
|
210
|
+
<div className="border-t border-border bg-card/50 px-4 py-4">
|
|
211
|
+
<form onSubmit={handleSubmit} className="max-w-4xl mx-auto flex gap-2">
|
|
212
|
+
<input
|
|
213
|
+
type="text"
|
|
214
|
+
value={input}
|
|
215
|
+
onChange={(e) => setInput(e.target.value)}
|
|
216
|
+
placeholder="Type your message..."
|
|
217
|
+
className="flex-1 bg-secondary border border-border rounded-lg px-4 py-2 text-foreground placeholder-muted-foreground focus:ring-2 focus:ring-ring focus:border-transparent"
|
|
218
|
+
disabled={isLoading}
|
|
219
|
+
/>
|
|
220
|
+
<Button
|
|
221
|
+
type="submit"
|
|
222
|
+
disabled={!input.trim() || isLoading}
|
|
223
|
+
>
|
|
224
|
+
{isLoading ? (
|
|
225
|
+
<Loader2 className="w-5 h-5 animate-spin" />
|
|
226
|
+
) : (
|
|
227
|
+
<Send className="w-5 h-5" />
|
|
228
|
+
)}
|
|
229
|
+
</Button>
|
|
230
|
+
</form>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
)
|
|
234
|
+
}
|