@digilogiclabs/create-saas-app 2.11.0 → 2.12.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/CHANGELOG.md +6 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/template-generator.d.ts.map +1 -1
- package/dist/generators/template-generator.js +15 -8
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/dist/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/dist/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/dist/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/dist/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/dist/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/dist/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/dist/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/dist/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/dist/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/dist/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/dist/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/dist/templates/shared/mock/web/.env.local +55 -0
- package/dist/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/dist/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/dist/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/dist/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/dist/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/dist/templates/web/base/template/eslint.config.mjs +14 -0
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/dist/templates/web/base/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/dist/templates/web/base/template/src/app/page.tsx +97 -193
- package/dist/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/dist/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/base/template/src/components/shared/header.tsx +229 -63
- package/dist/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/dist/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/dist/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/dist/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/dist/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/dist/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/dist/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/dist/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/dist/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/dist/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/dist/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/dist/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/dist/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/dist/templates/web/ui-package-test/template/package.json +19 -23
- package/dist/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/dist/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/dist/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/package.json +1 -1
- package/src/templates/shared/admin/web/src/components/admin-nav.tsx +3 -3
- package/src/templates/shared/auth/supabase/web/src/lib/auth-session.ts +36 -16
- package/src/templates/shared/auth/supabase/web/src/middleware.ts +6 -0
- package/src/templates/shared/cookie-consent/web/components/cookie-consent.tsx +5 -5
- package/src/templates/shared/design/web/src/components/ui/button.tsx +56 -0
- package/src/templates/shared/email/web/src/lib/email/client.ts +1 -1
- package/src/templates/shared/error-pages/web/src/app/error.tsx +13 -11
- package/src/templates/shared/error-pages/web/src/app/global-error.tsx +2 -0
- package/src/templates/shared/error-pages/web/src/app/not-found.tsx +6 -6
- package/src/templates/shared/legal/web/src/app/(legal)/privacy/page.tsx +4 -4
- package/src/templates/shared/legal/web/src/app/(legal)/terms/page.tsx +4 -4
- package/src/templates/shared/loading/web/components/skeleton.tsx +4 -4
- package/src/templates/shared/mock/web/.env.local +55 -0
- package/src/templates/shared/mock/web/src/components/mock-auth-provider.tsx +72 -0
- package/src/templates/shared/mock/web/src/components/mock-banner.tsx +29 -0
- package/src/templates/shared/mock/web/src/lib/mock.ts +147 -0
- package/src/templates/shared/payments/web/src/app/api/webhooks/stripe/route.ts +10 -4
- package/src/templates/shared/redis/web/src/lib/redis.ts +1 -1
- package/src/templates/web/base/template/eslint.config.mjs +14 -0
- package/src/templates/web/base/template/src/app/auth/callback/route.ts +1 -1
- package/src/templates/web/base/template/src/app/checkout/page.tsx +76 -103
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +145 -329
- package/src/templates/web/base/template/src/app/layout.tsx +40 -38
- package/src/templates/web/base/template/src/app/login/page.tsx +116 -66
- package/src/templates/web/base/template/src/app/page.tsx +97 -193
- package/src/templates/web/base/template/src/app/settings/page.tsx +154 -0
- package/src/templates/web/base/template/src/app/signup/page.tsx +117 -66
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/base/template/src/components/shared/header.tsx +229 -63
- package/src/templates/web/ui-auth/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-auth/template/src/app/checkout/page.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +81 -91
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +22 -45
- package/src/templates/web/ui-auth/template/src/app/page.tsx +106 -306
- package/src/templates/web/ui-auth/template/src/app/setup/page.tsx +387 -402
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +24 -47
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +229 -94
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +38 -45
- package/src/templates/web/ui-auth-ai/template/src/app/login/page.tsx +86 -0
- package/src/templates/web/ui-auth-ai/template/src/app/page.tsx +107 -193
- package/src/templates/web/ui-auth-ai/template/src/app/signup/page.tsx +105 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ai/audio-generator.tsx +144 -140
- package/src/templates/web/ui-auth-ai/template/src/components/ai/video-generator.tsx +156 -157
- package/src/templates/web/ui-auth-ai/template/src/components/auth/login-form.tsx +7 -3
- package/src/templates/web/ui-auth-ai/template/src/components/providers/app-providers.tsx +25 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-ai/template/src/components/shared/header.tsx +228 -0
- package/src/templates/web/ui-auth-ai/template/src/components/ui/button.tsx +5 -5
- package/src/templates/web/ui-auth-ai/template/src/components/ui/input.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/select.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/textarea.tsx +1 -1
- package/src/templates/web/ui-auth-ai/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-ai/template/src/lib/supabase.ts +6 -4
- package/src/templates/web/ui-auth-ai/template/src/providers/auth-provider.tsx +7 -5
- package/src/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +104 -296
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +70 -81
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +9 -9
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +4 -104
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +69 -337
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +55 -68
- package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +13 -13
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +4 -123
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +4 -4
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +25 -28
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +229 -230
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +339 -339
- package/src/templates/web/ui-auth-payments-ai/template/src/app/ai/page.tsx +305 -309
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +62 -312
- package/src/templates/web/ui-auth-payments-ai/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +68 -83
- package/src/templates/web/ui-auth-payments-ai/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +20 -20
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +140 -394
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +28 -27
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +51 -66
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +50 -79
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +58 -111
- package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-ai/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-ai/template/src/lib/actions/auth.ts +245 -245
- package/src/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +27 -27
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +40 -38
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +122 -385
- package/src/templates/web/ui-auth-payments-audio/template/src/app/setup/page.tsx +340 -344
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/auth-status.tsx +37 -52
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +49 -103
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +60 -140
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +229 -252
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/auth.ts +3 -3
- package/src/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +63 -192
- package/src/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +109 -125
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +38 -36
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +9 -109
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +132 -392
- package/src/templates/web/ui-auth-payments-video/template/src/app/setup/page.tsx +346 -350
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +9 -128
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/login-form.tsx +90 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/client/signup-form.tsx +105 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +8 -3
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +229 -246
- package/src/templates/web/ui-only/template/eslint.config.mjs +14 -0
- package/src/templates/web/ui-only/template/src/app/checkout/page.tsx +2 -2
- package/src/templates/web/ui-only/template/src/app/login/page.tsx +69 -63
- package/src/templates/web/ui-only/template/src/app/page.tsx +69 -91
- package/src/templates/web/ui-only/template/src/app/signup/page.tsx +94 -79
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +1 -6
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +90 -53
- package/src/templates/web/ui-package-test/template/package.json +19 -23
- package/src/templates/web/ui-package-test/template/postcss.config.mjs +8 -0
- package/src/templates/web/ui-package-test/template/src/app/globals.css +88 -0
- package/src/templates/web/ui-package-test/template/src/app/layout.tsx +27 -0
- package/src/templates/web/ui-package-test/template/src/app/page.tsx +46 -106
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/dist/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/dist/templates/web/base/template/.eslintrc.js +0 -8
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/base/template/src/test/setup.ts +0 -74
- package/dist/templates/web/base/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +0 -655
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +0 -683
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/_layout.tsx +0 -124
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/app.json +0 -74
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/babel.config.js +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +0 -787
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/eas.json +0 -25
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/expo-env.d.ts +0 -3
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -346
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/jest-setup.ts +0 -37
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -180
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/metro.config.js +0 -11
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +0 -122
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -599
- package/src/templates/mobile/ui-auth-payments-ai-rag/template/tsconfig.json +0 -32
- package/src/templates/web/base/template/.eslintrc.js +0 -8
- package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/base/template/src/test/setup.ts +0 -74
- package/src/templates/web/base/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-ai/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-ai/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +0 -434
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +0 -642
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +0 -466
- package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +0 -393
- package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +0 -457
- package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +0 -478
- package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +0 -250
- package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +0 -73
- package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +0 -622
- package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +0 -396
- package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/src/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/src/templates/web/ui-only/template/src/test/setup.ts +0 -74
- package/src/templates/web/ui-only/template/vitest.config.ts +0 -17
package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useState, useRef, useEffect } from 'react'
|
|
4
|
-
import { Button } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
-
import {
|
|
6
|
-
Send,
|
|
7
|
-
Loader2,
|
|
8
|
-
Copy,
|
|
9
|
-
ThumbsUp,
|
|
10
|
-
ThumbsDown,
|
|
11
|
-
RefreshCw,
|
|
12
|
-
StopCircle,
|
|
13
|
-
Mic,
|
|
14
|
-
MicOff,
|
|
15
|
-
FileText,
|
|
16
|
-
ExternalLink,
|
|
17
|
-
Sparkles
|
|
18
|
-
} from 'lucide-react'
|
|
19
|
-
import { toast } from 'sonner'
|
|
20
|
-
import { motion, AnimatePresence } from 'framer-motion'
|
|
21
|
-
import type { UseRAGSystemReturn } from '../../hooks/useRAGSystem'
|
|
22
|
-
import type { RAGResponse, RAGSearchResult } from '@digilogiclabs/saas-factory-ai-types'
|
|
23
|
-
|
|
24
|
-
interface RAGChatInterfaceProps {
|
|
25
|
-
ragSystem: UseRAGSystemReturn<any>
|
|
26
|
-
enableStreaming?: boolean
|
|
27
|
-
showSources?: boolean
|
|
28
|
-
showConfidence?: boolean
|
|
29
|
-
onError?: (error: Error) => void
|
|
30
|
-
className?: string
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface Message {
|
|
34
|
-
id: string
|
|
35
|
-
type: 'user' | 'assistant'
|
|
36
|
-
content: string
|
|
37
|
-
sources?: RAGSearchResult[]
|
|
38
|
-
confidence?: number
|
|
39
|
-
timestamp: Date
|
|
40
|
-
isStreaming?: boolean
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function RAGChatInterface({
|
|
44
|
-
ragSystem,
|
|
45
|
-
enableStreaming = true,
|
|
46
|
-
showSources = true,
|
|
47
|
-
showConfidence = false,
|
|
48
|
-
onError,
|
|
49
|
-
className = ''
|
|
50
|
-
}: RAGChatInterfaceProps) {
|
|
51
|
-
const [messages, setMessages] = useState<Message[]>([])
|
|
52
|
-
const [input, setInput] = useState('')
|
|
53
|
-
const [isRecording, setIsRecording] = useState(false)
|
|
54
|
-
const messagesEndRef = useRef<HTMLDivElement>(null)
|
|
55
|
-
const inputRef = useRef<HTMLTextAreaElement>(null)
|
|
56
|
-
|
|
57
|
-
const scrollToBottom = () => {
|
|
58
|
-
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' })
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
scrollToBottom()
|
|
63
|
-
}, [messages])
|
|
64
|
-
|
|
65
|
-
// Handle streaming responses
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (ragSystem.streamingState.isStreaming) {
|
|
68
|
-
setMessages(prev => {
|
|
69
|
-
const newMessages = [...prev]
|
|
70
|
-
const lastMessage = newMessages[newMessages.length - 1]
|
|
71
|
-
|
|
72
|
-
if (lastMessage && lastMessage.type === 'assistant' && lastMessage.isStreaming) {
|
|
73
|
-
// Update existing streaming message
|
|
74
|
-
lastMessage.content = ragSystem.streamingState.currentResponse
|
|
75
|
-
lastMessage.sources = ragSystem.streamingState.sources
|
|
76
|
-
lastMessage.confidence = ragSystem.streamingState.confidence
|
|
77
|
-
} else {
|
|
78
|
-
// Create new streaming message
|
|
79
|
-
newMessages.push({
|
|
80
|
-
id: `streaming-${Date.now()}`,
|
|
81
|
-
type: 'assistant',
|
|
82
|
-
content: ragSystem.streamingState.currentResponse,
|
|
83
|
-
sources: ragSystem.streamingState.sources,
|
|
84
|
-
confidence: ragSystem.streamingState.confidence,
|
|
85
|
-
timestamp: new Date(),
|
|
86
|
-
isStreaming: true
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return newMessages
|
|
91
|
-
})
|
|
92
|
-
} else {
|
|
93
|
-
// Finalize streaming message
|
|
94
|
-
setMessages(prev => {
|
|
95
|
-
const newMessages = [...prev]
|
|
96
|
-
const lastMessage = newMessages[newMessages.length - 1]
|
|
97
|
-
|
|
98
|
-
if (lastMessage && lastMessage.isStreaming) {
|
|
99
|
-
lastMessage.isStreaming = false
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return newMessages
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
}, [ragSystem.streamingState])
|
|
106
|
-
|
|
107
|
-
const handleSubmit = async (e?: React.FormEvent) => {
|
|
108
|
-
e?.preventDefault()
|
|
109
|
-
|
|
110
|
-
if (!input.trim() || !ragSystem.canQuery) return
|
|
111
|
-
|
|
112
|
-
const userMessage: Message = {
|
|
113
|
-
id: `user-${Date.now()}`,
|
|
114
|
-
type: 'user',
|
|
115
|
-
content: input.trim(),
|
|
116
|
-
timestamp: new Date()
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
setMessages(prev => [...prev, userMessage])
|
|
120
|
-
setInput('')
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const response = await ragSystem.query(input.trim(), {
|
|
124
|
-
stream: enableStreaming,
|
|
125
|
-
includeMetadata: true
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
if (!enableStreaming) {
|
|
129
|
-
// Add assistant response for non-streaming
|
|
130
|
-
const assistantMessage: Message = {
|
|
131
|
-
id: `assistant-${Date.now()}`,
|
|
132
|
-
type: 'assistant',
|
|
133
|
-
content: response.response,
|
|
134
|
-
sources: response.sources,
|
|
135
|
-
confidence: response.confidence,
|
|
136
|
-
timestamp: new Date()
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
setMessages(prev => [...prev, assistantMessage])
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.error('Chat error:', error)
|
|
144
|
-
onError?.(error as Error)
|
|
145
|
-
|
|
146
|
-
const errorMessage: Message = {
|
|
147
|
-
id: `error-${Date.now()}`,
|
|
148
|
-
type: 'assistant',
|
|
149
|
-
content: 'I apologize, but I encountered an error processing your request. Please try again.',
|
|
150
|
-
timestamp: new Date()
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
setMessages(prev => [...prev, errorMessage])
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const handleKeyPress = (e: React.KeyboardEvent) => {
|
|
158
|
-
if (e.key === 'Enter' && !e.shiftKey) {
|
|
159
|
-
e.preventDefault()
|
|
160
|
-
handleSubmit()
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const handleCopy = async (content: string) => {
|
|
165
|
-
try {
|
|
166
|
-
await navigator.clipboard.writeText(content)
|
|
167
|
-
toast.success('Copied to clipboard')
|
|
168
|
-
} catch (error) {
|
|
169
|
-
toast.error('Failed to copy')
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const handleFeedback = (messageId: string, feedback: 'positive' | 'negative') => {
|
|
174
|
-
// Implementation for feedback tracking
|
|
175
|
-
toast.success(`Feedback recorded: ${feedback}`)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const handleStop = () => {
|
|
179
|
-
ragSystem.cancelOperation()
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const renderMessage = (message: Message) => {
|
|
183
|
-
const isUser = message.type === 'user'
|
|
184
|
-
|
|
185
|
-
return (
|
|
186
|
-
<motion.div
|
|
187
|
-
key={message.id}
|
|
188
|
-
initial={{ opacity: 0, y: 20 }}
|
|
189
|
-
animate={{ opacity: 1, y: 0 }}
|
|
190
|
-
className={`flex ${isUser ? 'justify-end' : 'justify-start'} mb-4`}
|
|
191
|
-
>
|
|
192
|
-
<div className={`max-w-[80%] ${isUser ? 'order-2' : 'order-1'}`}>
|
|
193
|
-
{/* Message bubble */}
|
|
194
|
-
<div
|
|
195
|
-
className={`rounded-2xl px-4 py-3 ${
|
|
196
|
-
isUser
|
|
197
|
-
? 'bg-blue-500 text-white'
|
|
198
|
-
: 'bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700'
|
|
199
|
-
}`}
|
|
200
|
-
>
|
|
201
|
-
<div className="whitespace-pre-wrap">
|
|
202
|
-
{message.content}
|
|
203
|
-
{message.isStreaming && (
|
|
204
|
-
<span className="inline-block w-2 h-5 bg-current animate-pulse ml-1" />
|
|
205
|
-
)}
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
{/* Confidence score */}
|
|
209
|
-
{!isUser && showConfidence && message.confidence !== undefined && (
|
|
210
|
-
<div className="mt-2 text-xs text-gray-500 dark:text-gray-400">
|
|
211
|
-
Confidence: {Math.round(message.confidence * 100)}%
|
|
212
|
-
</div>
|
|
213
|
-
)}
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
{/* Sources */}
|
|
217
|
-
{!isUser && showSources && message.sources && message.sources.length > 0 && (
|
|
218
|
-
<div className="mt-3 space-y-2">
|
|
219
|
-
<p className="text-xs font-medium text-gray-600 dark:text-gray-400">
|
|
220
|
-
Sources:
|
|
221
|
-
</p>
|
|
222
|
-
<div className="space-y-1">
|
|
223
|
-
{message.sources.slice(0, 3).map((source, index) => (
|
|
224
|
-
<div
|
|
225
|
-
key={index}
|
|
226
|
-
className="flex items-center gap-2 text-xs p-2 bg-gray-50 dark:bg-gray-800/50 rounded-lg"
|
|
227
|
-
>
|
|
228
|
-
<FileText className="w-3 h-3 text-gray-400" />
|
|
229
|
-
<span className="flex-1 truncate">{source.title || source.content}</span>
|
|
230
|
-
{source.score && (
|
|
231
|
-
<span className="text-gray-500">
|
|
232
|
-
{Math.round(source.score * 100)}%
|
|
233
|
-
</span>
|
|
234
|
-
)}
|
|
235
|
-
</div>
|
|
236
|
-
))}
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
)}
|
|
240
|
-
|
|
241
|
-
{/* Message actions */}
|
|
242
|
-
{!isUser && !message.isStreaming && (
|
|
243
|
-
<div className="flex items-center gap-1 mt-2">
|
|
244
|
-
<Button
|
|
245
|
-
variant="ghost"
|
|
246
|
-
size="sm"
|
|
247
|
-
onClick={() => handleCopy(message.content)}
|
|
248
|
-
className="h-6 px-2"
|
|
249
|
-
>
|
|
250
|
-
<Copy className="w-3 h-3" />
|
|
251
|
-
</Button>
|
|
252
|
-
<Button
|
|
253
|
-
variant="ghost"
|
|
254
|
-
size="sm"
|
|
255
|
-
onClick={() => handleFeedback(message.id, 'positive')}
|
|
256
|
-
className="h-6 px-2"
|
|
257
|
-
>
|
|
258
|
-
<ThumbsUp className="w-3 h-3" />
|
|
259
|
-
</Button>
|
|
260
|
-
<Button
|
|
261
|
-
variant="ghost"
|
|
262
|
-
size="sm"
|
|
263
|
-
onClick={() => handleFeedback(message.id, 'negative')}
|
|
264
|
-
className="h-6 px-2"
|
|
265
|
-
>
|
|
266
|
-
<ThumbsDown className="w-3 h-3" />
|
|
267
|
-
</Button>
|
|
268
|
-
</div>
|
|
269
|
-
)}
|
|
270
|
-
|
|
271
|
-
{/* Timestamp */}
|
|
272
|
-
<div className={`text-xs text-gray-500 mt-1 ${isUser ? 'text-right' : 'text-left'}`}>
|
|
273
|
-
{message.timestamp.toLocaleTimeString()}
|
|
274
|
-
</div>
|
|
275
|
-
</div>
|
|
276
|
-
</motion.div>
|
|
277
|
-
)
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return (
|
|
281
|
-
<div className={`flex flex-col h-full ${className}`}>
|
|
282
|
-
{/* Header */}
|
|
283
|
-
<div className="flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700">
|
|
284
|
-
<div className="flex items-center gap-2">
|
|
285
|
-
<Sparkles className="w-5 h-5 text-blue-500" />
|
|
286
|
-
<h3 className="font-semibold">AI Assistant</h3>
|
|
287
|
-
<div className={`w-2 h-2 rounded-full ${
|
|
288
|
-
ragSystem.isReady ? 'bg-green-500' : 'bg-yellow-500'
|
|
289
|
-
}`} />
|
|
290
|
-
</div>
|
|
291
|
-
|
|
292
|
-
<div className="flex items-center gap-2">
|
|
293
|
-
{ragSystem.streamingState.isStreaming && (
|
|
294
|
-
<Button
|
|
295
|
-
variant="outline"
|
|
296
|
-
size="sm"
|
|
297
|
-
onClick={handleStop}
|
|
298
|
-
className="text-red-500 border-red-200 hover:bg-red-50"
|
|
299
|
-
>
|
|
300
|
-
<StopCircle className="w-4 h-4 mr-1" />
|
|
301
|
-
Stop
|
|
302
|
-
</Button>
|
|
303
|
-
)}
|
|
304
|
-
|
|
305
|
-
<Button
|
|
306
|
-
variant="outline"
|
|
307
|
-
size="sm"
|
|
308
|
-
onClick={() => setMessages([])}
|
|
309
|
-
disabled={ragSystem.isLoading}
|
|
310
|
-
>
|
|
311
|
-
<RefreshCw className="w-4 h-4" />
|
|
312
|
-
</Button>
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
|
|
316
|
-
{/* Messages */}
|
|
317
|
-
<div className="flex-1 overflow-y-auto p-4 space-y-4">
|
|
318
|
-
<AnimatePresence>
|
|
319
|
-
{messages.length === 0 ? (
|
|
320
|
-
<div className="text-center text-gray-500 dark:text-gray-400 mt-8">
|
|
321
|
-
<Sparkles className="w-12 h-12 mx-auto mb-4 text-gray-300" />
|
|
322
|
-
<p className="text-lg font-medium mb-2">Welcome to your AI Knowledge Assistant</p>
|
|
323
|
-
<p className="text-sm">
|
|
324
|
-
Ask me anything about your knowledge base. I can help you find information,
|
|
325
|
-
analyze content, and provide insights.
|
|
326
|
-
</p>
|
|
327
|
-
</div>
|
|
328
|
-
) : (
|
|
329
|
-
messages.map(renderMessage)
|
|
330
|
-
)}
|
|
331
|
-
</AnimatePresence>
|
|
332
|
-
|
|
333
|
-
<div ref={messagesEndRef} />
|
|
334
|
-
</div>
|
|
335
|
-
|
|
336
|
-
{/* Input */}
|
|
337
|
-
<div className="p-4 border-t border-gray-200 dark:border-gray-700">
|
|
338
|
-
<form onSubmit={handleSubmit} className="flex gap-2">
|
|
339
|
-
<div className="flex-1 relative">
|
|
340
|
-
<textarea
|
|
341
|
-
ref={inputRef}
|
|
342
|
-
value={input}
|
|
343
|
-
onChange={(e) => setInput(e.target.value)}
|
|
344
|
-
onKeyPress={handleKeyPress}
|
|
345
|
-
placeholder={ragSystem.isReady ? "Ask me anything..." : "Initializing..."}
|
|
346
|
-
disabled={!ragSystem.canQuery}
|
|
347
|
-
className="w-full resize-none rounded-xl border border-gray-200 dark:border-gray-700 px-4 py-3 pr-12 focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 max-h-32"
|
|
348
|
-
rows={1}
|
|
349
|
-
/>
|
|
350
|
-
|
|
351
|
-
{/* Voice input button */}
|
|
352
|
-
<Button
|
|
353
|
-
type="button"
|
|
354
|
-
variant="ghost"
|
|
355
|
-
size="sm"
|
|
356
|
-
className="absolute right-2 top-1/2 transform -translate-y-1/2"
|
|
357
|
-
onClick={() => setIsRecording(!isRecording)}
|
|
358
|
-
disabled={!ragSystem.canQuery}
|
|
359
|
-
>
|
|
360
|
-
{isRecording ? (
|
|
361
|
-
<MicOff className="w-4 h-4 text-red-500" />
|
|
362
|
-
) : (
|
|
363
|
-
<Mic className="w-4 h-4" />
|
|
364
|
-
)}
|
|
365
|
-
</Button>
|
|
366
|
-
</div>
|
|
367
|
-
|
|
368
|
-
<Button
|
|
369
|
-
type="submit"
|
|
370
|
-
disabled={!input.trim() || !ragSystem.canQuery || ragSystem.isLoading}
|
|
371
|
-
className="px-4 py-3"
|
|
372
|
-
>
|
|
373
|
-
{ragSystem.isLoading ? (
|
|
374
|
-
<Loader2 className="w-4 h-4 animate-spin" />
|
|
375
|
-
) : (
|
|
376
|
-
<Send className="w-4 h-4" />
|
|
377
|
-
)}
|
|
378
|
-
</Button>
|
|
379
|
-
</form>
|
|
380
|
-
|
|
381
|
-
{/* Status indicator */}
|
|
382
|
-
<div className="flex items-center justify-between mt-2 text-xs text-gray-500">
|
|
383
|
-
<span>
|
|
384
|
-
{ragSystem.totalDocuments} documents • {ragSystem.queryHistory.length} recent queries
|
|
385
|
-
</span>
|
|
386
|
-
<span>
|
|
387
|
-
Press Enter to send, Shift+Enter for new line
|
|
388
|
-
</span>
|
|
389
|
-
</div>
|
|
390
|
-
</div>
|
|
391
|
-
</div>
|
|
392
|
-
)
|
|
393
|
-
}
|