@retrivora-ai/rag-engine 2.4.3 → 2.4.6
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/README.md +22 -0
- package/dist/{BatchProcessor-zbQMaZHm.d.mts → BatchProcessor-BGslIR5l.d.mts} +65 -4
- package/dist/{BatchProcessor-D42E706a.d.ts → BatchProcessor-C3gY6kZ0.d.ts} +65 -4
- package/dist/handlers/index.js +668 -837
- package/dist/handlers/index.mjs +678 -837
- package/dist/index.css +5 -0
- package/dist/index.d.mts +4 -28
- package/dist/index.d.ts +4 -28
- package/dist/index.js +91 -43
- package/dist/index.min.css +1 -1
- package/dist/index.mjs +91 -43
- package/dist/server.d.mts +21 -7
- package/dist/server.d.ts +21 -7
- package/dist/server.js +731 -875
- package/dist/server.mjs +741 -875
- package/package.json +11 -4
- package/src/LicensedRetrivora.ts +0 -278
- package/src/app/api/chat/route.ts +0 -4
- package/src/app/api/health/route.ts +0 -5
- package/src/app/api/ingest/route.ts +0 -27
- package/src/app/api/suggestions/route.ts +0 -5
- package/src/app/api/upload/route.ts +0 -5
- package/src/app/constants.tsx +0 -270
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -449
- package/src/app/layout.tsx +0 -22
- package/src/app/page.tsx +0 -64
- package/src/app/types.ts +0 -30
- package/src/browser.tsx +0 -127
- package/src/components/ChatWidget.tsx +0 -393
- package/src/components/ChatWindow.tsx +0 -952
- package/src/components/CodeViewer.tsx +0 -56
- package/src/components/ConfigProvider.tsx +0 -141
- package/src/components/DocumentUpload.tsx +0 -354
- package/src/components/DynamicChart.tsx +0 -297
- package/src/components/HourglassLoader.tsx +0 -87
- package/src/components/MarkdownComponents.tsx +0 -186
- package/src/components/MessageBubble.tsx +0 -498
- package/src/components/ObservabilityPanel.tsx +0 -374
- package/src/components/ProductCard.tsx +0 -107
- package/src/components/ProductCarousel.tsx +0 -97
- package/src/components/SourceCard.tsx +0 -61
- package/src/components/ThemeProvider.tsx +0 -8
- package/src/components/ThemeToggle.tsx +0 -29
- package/src/components/ThinkingBlock.tsx +0 -75
- package/src/components/UIDispatcher.tsx +0 -342
- package/src/components/VisualizationRenderer.tsx +0 -621
- package/src/components/constants.tsx +0 -503
- package/src/config/ConfigBuilder.ts +0 -285
- package/src/config/EmbeddingStrategy.ts +0 -148
- package/src/config/LicenseConfigResolver.ts +0 -298
- package/src/config/RagConfig.ts +0 -328
- package/src/config/UniversalProfiles.ts +0 -82
- package/src/config/constants.ts +0 -64
- package/src/config/serverConfig.ts +0 -378
- package/src/config/uiConstants.ts +0 -47
- package/src/core/BatchProcessor.ts +0 -385
- package/src/core/CircuitBreaker.ts +0 -118
- package/src/core/ConfigFetcher.ts +0 -220
- package/src/core/ConfigResolver.ts +0 -165
- package/src/core/ConfigValidator.ts +0 -197
- package/src/core/DatabaseStorage.ts +0 -526
- package/src/core/FreeTierLimitsGuard.ts +0 -281
- package/src/core/LLMRouter.ts +0 -79
- package/src/core/LangChainAgent.ts +0 -132
- package/src/core/LicenseValidator.ts +0 -284
- package/src/core/LicenseVerifier.ts +0 -261
- package/src/core/MultiAgentCoordinator.ts +0 -239
- package/src/core/Pipeline.ts +0 -1279
- package/src/core/PluginManager.ts +0 -277
- package/src/core/ProjectSettings.ts +0 -247
- package/src/core/ProviderHealthCheck.ts +0 -133
- package/src/core/ProviderInterfaces.ts +0 -37
- package/src/core/ProviderRegistry.ts +0 -156
- package/src/core/QueryProcessor.ts +0 -399
- package/src/core/Retrivora.ts +0 -98
- package/src/core/VectorPlugin.ts +0 -193
- package/src/core/mcp.ts +0 -261
- package/src/exceptions/index.ts +0 -131
- package/src/handlers/index.ts +0 -1625
- package/src/hooks/useHydrated.ts +0 -13
- package/src/hooks/useProjectSettings.ts +0 -105
- package/src/hooks/useRagChat.ts +0 -436
- package/src/hooks/useStoredMessages.ts +0 -64
- package/src/index.css +0 -4269
- package/src/index.ts +0 -137
- package/src/lib/plugin.ts +0 -24
- package/src/llm/ILLMProvider.ts +0 -60
- package/src/llm/LLMFactory.ts +0 -141
- package/src/llm/providers/AnthropicProvider.ts +0 -215
- package/src/llm/providers/GeminiProvider.ts +0 -311
- package/src/llm/providers/GroqProvider.ts +0 -184
- package/src/llm/providers/OllamaProvider.ts +0 -232
- package/src/llm/providers/OpenAIProvider.ts +0 -188
- package/src/llm/providers/QwenProvider.ts +0 -199
- package/src/llm/providers/UniversalLLMAdapter.ts +0 -422
- package/src/llm/utils.ts +0 -46
- package/src/providers/graphdb/BaseGraphProvider.ts +0 -43
- package/src/providers/graphdb/SimpleGraphProvider.ts +0 -66
- package/src/providers/vectordb/BaseVectorProvider.ts +0 -98
- package/src/providers/vectordb/ChromaDBProvider.ts +0 -130
- package/src/providers/vectordb/MilvusProvider.ts +0 -134
- package/src/providers/vectordb/MongoDBProvider.ts +0 -250
- package/src/providers/vectordb/MultiTablePostgresProvider.ts +0 -461
- package/src/providers/vectordb/PineconeProvider.ts +0 -295
- package/src/providers/vectordb/PostgreSQLProvider.ts +0 -227
- package/src/providers/vectordb/QdrantProvider.ts +0 -294
- package/src/providers/vectordb/RedisProvider.ts +0 -105
- package/src/providers/vectordb/UniversalVectorProvider.ts +0 -221
- package/src/providers/vectordb/WeaviateProvider.ts +0 -172
- package/src/rag/DocumentChunker.ts +0 -144
- package/src/rag/EntityExtractor.ts +0 -90
- package/src/rag/LlamaIndexIngestor.ts +0 -60
- package/src/rag/Reranker.ts +0 -106
- package/src/rendering/IntentClassifier.ts +0 -167
- package/src/rendering/RendererRegistry.ts +0 -164
- package/src/rendering/RuleEngine.ts +0 -67
- package/src/rendering/VisualizationDecisionEngine.ts +0 -164
- package/src/rendering/__tests__/VisualizationDecisionEngine.test.ts +0 -237
- package/src/rendering/index.ts +0 -12
- package/src/rendering/rules/Rule1SpecificInfoRule.ts +0 -28
- package/src/rendering/rules/Rule2ComparisonRule.ts +0 -24
- package/src/rendering/rules/Rule3ProductDiscoveryRule.ts +0 -28
- package/src/rendering/rules/Rule4AnalyticalRule.ts +0 -38
- package/src/rendering/rules/Rule5MixedResponseRule.ts +0 -29
- package/src/rendering/rules/Rule6SmallResultSetRule.ts +0 -24
- package/src/rendering/rules/Rule7LargeTableRule.ts +0 -35
- package/src/rendering/types.ts +0 -96
- package/src/server.ts +0 -156
- package/src/tailwind.css +0 -194
- package/src/telemetry/TelemetryService.ts +0 -330
- package/src/types/chat.ts +0 -89
- package/src/types/index.ts +0 -278
- package/src/types/pdf-parse.d.ts +0 -13
- package/src/types/props.ts +0 -169
- package/src/utils/DocumentParser.ts +0 -111
- package/src/utils/ProductExtractor.ts +0 -350
- package/src/utils/SchemaMapper.ts +0 -176
- package/src/utils/UITransformer.ts +0 -1812
- package/src/utils/synonyms.ts +0 -80
- package/src/utils/templateUtils.ts +0 -78
- package/src/version.ts +0 -6
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
Clock, Cpu, Zap, AlertTriangle, FileText, Layers,
|
|
6
|
-
ChevronDown, ChevronRight, CheckCircle, AlertCircle,
|
|
7
|
-
} from 'lucide-react';
|
|
8
|
-
import { ObservabilityTrace } from '../types';
|
|
9
|
-
|
|
10
|
-
// ─── Props ────────────────────────────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
interface ObservabilityPanelProps {
|
|
13
|
-
trace: ObservabilityTrace;
|
|
14
|
-
primaryColor?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
18
|
-
|
|
19
|
-
function fmtMs(ms: number): string {
|
|
20
|
-
return ms >= 1000 ? `${(ms / 1000).toFixed(2)}s` : `${Math.round(ms)}ms`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function fmtTokens(n: number): string {
|
|
24
|
-
return n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function ScoreBadge({ score }: { score: number }) {
|
|
28
|
-
const pct = Math.round(score * 100);
|
|
29
|
-
const color =
|
|
30
|
-
pct <= 20 ? 'text-emerald-600 bg-emerald-50 border-emerald-200 dark:text-emerald-400 dark:bg-emerald-500/10 dark:border-emerald-500/20'
|
|
31
|
-
: pct <= 50 ? 'text-amber-600 bg-amber-50 border-amber-200 dark:text-amber-400 dark:bg-amber-500/10 dark:border-amber-500/20'
|
|
32
|
-
: 'text-red-600 bg-red-50 border-red-200 dark:text-red-400 dark:bg-red-500/10 dark:border-red-500/20';
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<span className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-semibold border ${color}`}>
|
|
36
|
-
{pct <= 20 ? <CheckCircle className="w-3 h-3" /> : <AlertCircle className="w-3 h-3" />}
|
|
37
|
-
{pct}% hallucination risk
|
|
38
|
-
</span>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// ─── Tab content renderers ────────────────────────────────────────────────────
|
|
43
|
-
|
|
44
|
-
function RetrievalTab({ trace }: { trace: ObservabilityTrace }) {
|
|
45
|
-
return (
|
|
46
|
-
<div className="space-y-2">
|
|
47
|
-
<p className="text-[11px] text-slate-500 dark:text-white/40">
|
|
48
|
-
{trace.chunks.length} chunk{trace.chunks.length !== 1 ? 's' : ''} retrieved
|
|
49
|
-
{trace.rewrittenQuery && (
|
|
50
|
-
<span className="ml-2 italic">
|
|
51
|
-
(query rewritten: <em className="text-indigo-500">{trace.rewrittenQuery}</em>)
|
|
52
|
-
</span>
|
|
53
|
-
)}
|
|
54
|
-
</p>
|
|
55
|
-
<div className="space-y-1.5 max-h-56 overflow-y-auto pr-1 custom-scrollbar">
|
|
56
|
-
{trace.chunks.map((chunk, i) => (
|
|
57
|
-
<div
|
|
58
|
-
key={String(chunk.id)}
|
|
59
|
-
className="rounded-lg border border-slate-100 dark:border-white/8 bg-slate-50 dark:bg-white/3 p-2.5"
|
|
60
|
-
>
|
|
61
|
-
<div className="flex items-center justify-between mb-1">
|
|
62
|
-
<span className="text-[10px] font-mono text-slate-400 dark:text-white/30">
|
|
63
|
-
[{i + 1}] {String(chunk.id).slice(0, 20)}
|
|
64
|
-
</span>
|
|
65
|
-
<span className="text-[10px] font-semibold text-indigo-600 dark:text-indigo-400">
|
|
66
|
-
score: {chunk.score.toFixed(3)}
|
|
67
|
-
</span>
|
|
68
|
-
</div>
|
|
69
|
-
{/* Score bar */}
|
|
70
|
-
<div className="h-1 rounded-full bg-slate-200 dark:bg-white/10 mb-2 overflow-hidden">
|
|
71
|
-
<div
|
|
72
|
-
className="h-full rounded-full bg-indigo-500 dark:bg-indigo-400 transition-all"
|
|
73
|
-
style={{ width: `${Math.min(100, chunk.score * 100)}%` }}
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
<p className="text-[11px] text-slate-600 dark:text-white/60 line-clamp-2 leading-relaxed">
|
|
77
|
-
{chunk.content}
|
|
78
|
-
</p>
|
|
79
|
-
</div>
|
|
80
|
-
))}
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function LatencyTab({ trace }: { trace: ObservabilityTrace }) {
|
|
87
|
-
const { latency } = trace;
|
|
88
|
-
const bars = [
|
|
89
|
-
{ label: 'Embed', ms: latency.embedMs, color: '#6366f1' },
|
|
90
|
-
{ label: 'Retrieve', ms: latency.retrieveMs, color: '#10b981' },
|
|
91
|
-
...(latency.rerankMs != null ? [{ label: 'Rerank', ms: latency.rerankMs, color: '#f59e0b' }] : []),
|
|
92
|
-
{ label: 'Generate', ms: latency.generateMs, color: '#8b5cf6' },
|
|
93
|
-
];
|
|
94
|
-
const maxMs = Math.max(...bars.map(b => b.ms), 1);
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<div className="space-y-3">
|
|
98
|
-
<div className="flex items-center justify-between">
|
|
99
|
-
<span className="text-[11px] text-slate-500 dark:text-white/40">Pipeline stages</span>
|
|
100
|
-
<span className="text-[11px] font-semibold text-slate-700 dark:text-white/70">
|
|
101
|
-
Total: {fmtMs(latency.totalMs)}
|
|
102
|
-
</span>
|
|
103
|
-
</div>
|
|
104
|
-
<div className="space-y-2">
|
|
105
|
-
{bars.map((bar) => (
|
|
106
|
-
<div key={bar.label} className="space-y-0.5">
|
|
107
|
-
<div className="flex items-center justify-between">
|
|
108
|
-
<span className="text-[11px] text-slate-600 dark:text-white/60">{bar.label}</span>
|
|
109
|
-
<span className="text-[11px] font-mono text-slate-500 dark:text-white/40">{fmtMs(bar.ms)}</span>
|
|
110
|
-
</div>
|
|
111
|
-
<div className="h-2 rounded-full bg-slate-100 dark:bg-white/8 overflow-hidden">
|
|
112
|
-
<div
|
|
113
|
-
className="h-full rounded-full transition-all duration-700"
|
|
114
|
-
style={{
|
|
115
|
-
width: `${(bar.ms / maxMs) * 100}%`,
|
|
116
|
-
background: bar.color,
|
|
117
|
-
opacity: 0.85,
|
|
118
|
-
}}
|
|
119
|
-
/>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
))}
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function TokensTab({ trace }: { trace: ObservabilityTrace }) {
|
|
129
|
-
const { tokens } = trace;
|
|
130
|
-
if (!tokens) {
|
|
131
|
-
return <p className="text-[11px] text-slate-400 dark:text-white/30 italic">Token data not available.</p>;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const stats = [
|
|
135
|
-
{ label: 'Prompt Tokens', value: fmtTokens(tokens.promptTokens), color: 'text-indigo-600 dark:text-indigo-400' },
|
|
136
|
-
{ label: 'Completion Tokens', value: fmtTokens(tokens.completionTokens), color: 'text-emerald-600 dark:text-emerald-400' },
|
|
137
|
-
{ label: 'Total Tokens', value: fmtTokens(tokens.totalTokens), color: 'text-slate-700 dark:text-white/80' },
|
|
138
|
-
];
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<div className="space-y-3">
|
|
142
|
-
<div className="grid grid-cols-3 gap-2">
|
|
143
|
-
{stats.map((s) => (
|
|
144
|
-
<div key={s.label} className="rounded-lg border border-slate-100 dark:border-white/8 bg-slate-50 dark:bg-white/3 p-2.5 text-center">
|
|
145
|
-
<p className={`text-lg font-bold ${s.color}`}>{s.value}</p>
|
|
146
|
-
<p className="text-[10px] text-slate-400 dark:text-white/30 mt-0.5">{s.label}</p>
|
|
147
|
-
</div>
|
|
148
|
-
))}
|
|
149
|
-
</div>
|
|
150
|
-
{tokens.estimatedCostUsd != null && (
|
|
151
|
-
<div className="flex items-center justify-between rounded-lg border border-emerald-100 dark:border-emerald-500/20 bg-emerald-50 dark:bg-emerald-500/10 px-3 py-2">
|
|
152
|
-
<span className="text-[11px] text-emerald-700 dark:text-emerald-400 font-medium">Estimated Cost</span>
|
|
153
|
-
<span className="text-[11px] font-bold text-emerald-700 dark:text-emerald-400">
|
|
154
|
-
${tokens.estimatedCostUsd < 0.0001
|
|
155
|
-
? tokens.estimatedCostUsd.toExponential(2)
|
|
156
|
-
: tokens.estimatedCostUsd.toFixed(5)} USD
|
|
157
|
-
</span>
|
|
158
|
-
</div>
|
|
159
|
-
)}
|
|
160
|
-
{/* Visual token proportion bar */}
|
|
161
|
-
<div className="h-2 rounded-full overflow-hidden flex">
|
|
162
|
-
<div
|
|
163
|
-
className="h-full bg-indigo-500 dark:bg-indigo-400"
|
|
164
|
-
style={{ width: `${(tokens.promptTokens / tokens.totalTokens) * 100}%` }}
|
|
165
|
-
title="Prompt tokens"
|
|
166
|
-
/>
|
|
167
|
-
<div
|
|
168
|
-
className="h-full bg-emerald-500 dark:bg-emerald-400"
|
|
169
|
-
style={{ width: `${(tokens.completionTokens / tokens.totalTokens) * 100}%` }}
|
|
170
|
-
title="Completion tokens"
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
<div className="flex gap-3 text-[10px] text-slate-400 dark:text-white/30">
|
|
174
|
-
<span className="flex items-center gap-1"><span className="inline-block w-2 h-2 rounded-full bg-indigo-500" /> Prompt</span>
|
|
175
|
-
<span className="flex items-center gap-1"><span className="inline-block w-2 h-2 rounded-full bg-emerald-500" /> Completion</span>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function HallucinationTab({ trace }: { trace: ObservabilityTrace }) {
|
|
182
|
-
if (trace.hallucinationScore == null) {
|
|
183
|
-
return <p className="text-[11px] text-slate-400 dark:text-white/30 italic">Hallucination scoring not available for this response.</p>;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const score = trace.hallucinationScore;
|
|
187
|
-
const pct = Math.round(score * 100);
|
|
188
|
-
const barColor = pct <= 20 ? '#10b981' : pct <= 50 ? '#f59e0b' : '#ef4444';
|
|
189
|
-
|
|
190
|
-
return (
|
|
191
|
-
<div className="space-y-3">
|
|
192
|
-
<div className="flex items-center justify-between">
|
|
193
|
-
<ScoreBadge score={score} />
|
|
194
|
-
<span className="text-[11px] font-mono text-slate-500 dark:text-white/40">{pct}/100</span>
|
|
195
|
-
</div>
|
|
196
|
-
<div className="h-3 rounded-full bg-slate-100 dark:bg-white/8 overflow-hidden">
|
|
197
|
-
<div
|
|
198
|
-
className="h-full rounded-full transition-all duration-700"
|
|
199
|
-
style={{ width: `${pct}%`, background: barColor }}
|
|
200
|
-
/>
|
|
201
|
-
</div>
|
|
202
|
-
{trace.hallucinationReason && (
|
|
203
|
-
<div className="rounded-lg border border-slate-100 dark:border-white/8 bg-slate-50 dark:bg-white/3 p-2.5">
|
|
204
|
-
<p className="text-[11px] text-slate-500 dark:text-white/40 font-medium mb-0.5">AI self-assessment</p>
|
|
205
|
-
<p className="text-[11px] text-slate-700 dark:text-white/70 leading-relaxed">{trace.hallucinationReason}</p>
|
|
206
|
-
</div>
|
|
207
|
-
)}
|
|
208
|
-
<div className="flex gap-2 text-[10px] text-slate-400 dark:text-white/30">
|
|
209
|
-
<span className="flex items-center gap-1"><span className="inline-block w-2 h-2 rounded-full bg-emerald-500" /> 0–20%: Grounded</span>
|
|
210
|
-
<span className="flex items-center gap-1"><span className="inline-block w-2 h-2 rounded-full bg-amber-500" /> 21–50%: Uncertain</span>
|
|
211
|
-
<span className="flex items-center gap-1"><span className="inline-block w-2 h-2 rounded-full bg-red-500" /> 51–100%: Risk</span>
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function PromptTab({ trace }: { trace: ObservabilityTrace }) {
|
|
218
|
-
const [showSystem, setShowSystem] = React.useState(false);
|
|
219
|
-
return (
|
|
220
|
-
<div className="space-y-3">
|
|
221
|
-
<div>
|
|
222
|
-
<button
|
|
223
|
-
onClick={() => setShowSystem(s => !s)}
|
|
224
|
-
className="flex items-center gap-1.5 text-[11px] font-semibold text-slate-600 dark:text-white/60 hover:text-slate-900 dark:hover:text-white/80 transition-colors mb-1.5"
|
|
225
|
-
>
|
|
226
|
-
{showSystem ? <ChevronDown className="w-3 h-3" /> : <ChevronRight className="w-3 h-3" />}
|
|
227
|
-
System Prompt
|
|
228
|
-
</button>
|
|
229
|
-
{showSystem && (
|
|
230
|
-
<pre className="text-[10px] font-mono text-slate-600 dark:text-white/60 bg-slate-900 dark:bg-black/30 rounded-lg p-3 overflow-auto max-h-40 whitespace-pre-wrap leading-relaxed">
|
|
231
|
-
{trace.systemPrompt || '(empty)'}
|
|
232
|
-
</pre>
|
|
233
|
-
)}
|
|
234
|
-
</div>
|
|
235
|
-
<div>
|
|
236
|
-
<p className="text-[11px] font-semibold text-slate-600 dark:text-white/60 mb-1.5">User Prompt</p>
|
|
237
|
-
<pre className="text-[10px] font-mono text-slate-600 dark:text-white/60 bg-slate-900 dark:bg-black/30 rounded-lg p-3 overflow-auto max-h-40 whitespace-pre-wrap leading-relaxed">
|
|
238
|
-
{trace.userPrompt}
|
|
239
|
-
</pre>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function ChunksTab({ trace }: { trace: ObservabilityTrace }) {
|
|
246
|
-
const [expanded, setExpanded] = React.useState<Set<number>>(new Set());
|
|
247
|
-
const toggle = (i: number) => setExpanded(prev => {
|
|
248
|
-
const next = new Set(prev);
|
|
249
|
-
if (next.has(i)) {
|
|
250
|
-
next.delete(i);
|
|
251
|
-
} else {
|
|
252
|
-
next.add(i);
|
|
253
|
-
}
|
|
254
|
-
return next;
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
return (
|
|
258
|
-
<div className="space-y-1.5 max-h-64 overflow-y-auto pr-1 custom-scrollbar">
|
|
259
|
-
{trace.chunks.map((chunk, i) => {
|
|
260
|
-
const isOpen = expanded.has(i);
|
|
261
|
-
return (
|
|
262
|
-
<div
|
|
263
|
-
key={String(chunk.id)}
|
|
264
|
-
className="rounded-lg border border-slate-100 dark:border-white/8 bg-slate-50 dark:bg-white/3 overflow-hidden"
|
|
265
|
-
>
|
|
266
|
-
<button
|
|
267
|
-
onClick={() => toggle(i)}
|
|
268
|
-
className="w-full flex items-center justify-between px-3 py-2 text-left hover:bg-slate-100 dark:hover:bg-white/5 transition-colors"
|
|
269
|
-
>
|
|
270
|
-
<div className="flex items-center gap-2">
|
|
271
|
-
{isOpen ? <ChevronDown className="w-3 h-3 text-slate-400" /> : <ChevronRight className="w-3 h-3 text-slate-400" />}
|
|
272
|
-
<span className="text-[11px] font-medium text-slate-700 dark:text-white/70">
|
|
273
|
-
Chunk {i + 1}
|
|
274
|
-
</span>
|
|
275
|
-
<span className="text-[10px] font-mono text-slate-400 dark:text-white/30">
|
|
276
|
-
{String(chunk.id).slice(0, 16)}
|
|
277
|
-
</span>
|
|
278
|
-
</div>
|
|
279
|
-
<span className="text-[10px] font-semibold text-indigo-600 dark:text-indigo-400">
|
|
280
|
-
{chunk.score.toFixed(3)}
|
|
281
|
-
</span>
|
|
282
|
-
</button>
|
|
283
|
-
|
|
284
|
-
{isOpen && (
|
|
285
|
-
<div className="px-3 pb-3 space-y-2 border-t border-slate-100 dark:border-white/5 pt-2">
|
|
286
|
-
<div>
|
|
287
|
-
<p className="text-[10px] text-slate-400 dark:text-white/30 font-semibold uppercase tracking-wider mb-1">Content</p>
|
|
288
|
-
<p className="text-[11px] text-slate-600 dark:text-white/60 leading-relaxed whitespace-pre-wrap">
|
|
289
|
-
{chunk.content}
|
|
290
|
-
</p>
|
|
291
|
-
</div>
|
|
292
|
-
{Object.keys(chunk.metadata).length > 0 && (
|
|
293
|
-
<div>
|
|
294
|
-
<p className="text-[10px] text-slate-400 dark:text-white/30 font-semibold uppercase tracking-wider mb-1">Metadata</p>
|
|
295
|
-
<pre className="text-[10px] font-mono text-slate-500 dark:text-white/40 bg-slate-900 dark:bg-black/30 rounded-md p-2 overflow-auto max-h-24">
|
|
296
|
-
{JSON.stringify(chunk.metadata, null, 2)}
|
|
297
|
-
</pre>
|
|
298
|
-
</div>
|
|
299
|
-
)}
|
|
300
|
-
</div>
|
|
301
|
-
)}
|
|
302
|
-
</div>
|
|
303
|
-
);
|
|
304
|
-
})}
|
|
305
|
-
</div>
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// ─── Main component ───────────────────────────────────────────────────────────
|
|
310
|
-
|
|
311
|
-
type TabId = 'retrieval' | 'latency' | 'tokens' | 'hallucination' | 'prompt' | 'chunks';
|
|
312
|
-
|
|
313
|
-
const TABS: { id: TabId; label: string; icon: React.ReactNode }[] = [
|
|
314
|
-
{ id: 'retrieval', label: 'Retrieval', icon: <Layers className="w-3 h-3" /> },
|
|
315
|
-
{ id: 'latency', label: 'Latency', icon: <Clock className="w-3 h-3" /> },
|
|
316
|
-
{ id: 'tokens', label: 'Tokens', icon: <Cpu className="w-3 h-3" /> },
|
|
317
|
-
{ id: 'hallucination',label: 'Grounding', icon: <AlertTriangle className="w-3 h-3" /> },
|
|
318
|
-
{ id: 'prompt', label: 'Prompt', icon: <FileText className="w-3 h-3" /> },
|
|
319
|
-
{ id: 'chunks', label: 'Chunks', icon: <Zap className="w-3 h-3" /> },
|
|
320
|
-
];
|
|
321
|
-
|
|
322
|
-
export function ObservabilityPanel({ trace, primaryColor = '#6366f1' }: ObservabilityPanelProps) {
|
|
323
|
-
const [activeTab, setActiveTab] = React.useState<TabId>('retrieval');
|
|
324
|
-
|
|
325
|
-
return (
|
|
326
|
-
<div className="mt-2 w-[500px] max-w-full rounded-xl border border-slate-200 dark:border-white/8 bg-white dark:bg-slate-900/60 shadow-sm overflow-hidden text-[12px]">
|
|
327
|
-
{/* Header */}
|
|
328
|
-
<div
|
|
329
|
-
className="flex items-center gap-2 px-3 py-2 border-b border-slate-100 dark:border-white/8"
|
|
330
|
-
style={{ background: `${primaryColor}08` }}
|
|
331
|
-
>
|
|
332
|
-
<span
|
|
333
|
-
className="inline-flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider"
|
|
334
|
-
style={{ color: primaryColor }}
|
|
335
|
-
>
|
|
336
|
-
<Zap className="w-3 h-3" />
|
|
337
|
-
Observability Trace
|
|
338
|
-
</span>
|
|
339
|
-
<span className="text-[10px] text-slate-400 dark:text-white/30 ml-auto font-mono">
|
|
340
|
-
{trace.requestId}
|
|
341
|
-
</span>
|
|
342
|
-
</div>
|
|
343
|
-
|
|
344
|
-
{/* Tabs */}
|
|
345
|
-
<div className="flex border-b border-slate-100 dark:border-white/8 overflow-x-auto">
|
|
346
|
-
{TABS.map((tab) => (
|
|
347
|
-
<button
|
|
348
|
-
key={tab.id}
|
|
349
|
-
onClick={() => setActiveTab(tab.id)}
|
|
350
|
-
className={`flex items-center gap-1.5 px-3 py-2 text-[10px] font-semibold whitespace-nowrap transition-colors border-b-2 ${
|
|
351
|
-
activeTab === tab.id
|
|
352
|
-
? 'border-b-2 text-indigo-600 dark:text-indigo-400'
|
|
353
|
-
: 'border-transparent text-slate-400 dark:text-white/30 hover:text-slate-600 dark:hover:text-white/60'
|
|
354
|
-
}`}
|
|
355
|
-
style={activeTab === tab.id ? { borderBottomColor: primaryColor, color: primaryColor } : {}}
|
|
356
|
-
>
|
|
357
|
-
{tab.icon}
|
|
358
|
-
{tab.label}
|
|
359
|
-
</button>
|
|
360
|
-
))}
|
|
361
|
-
</div>
|
|
362
|
-
|
|
363
|
-
{/* Tab body */}
|
|
364
|
-
<div className="p-3">
|
|
365
|
-
{activeTab === 'retrieval' && <RetrievalTab trace={trace} />}
|
|
366
|
-
{activeTab === 'latency' && <LatencyTab trace={trace} />}
|
|
367
|
-
{activeTab === 'tokens' && <TokensTab trace={trace} />}
|
|
368
|
-
{activeTab === 'hallucination'&& <HallucinationTab trace={trace} />}
|
|
369
|
-
{activeTab === 'prompt' && <PromptTab trace={trace} />}
|
|
370
|
-
{activeTab === 'chunks' && <ChunksTab trace={trace} />}
|
|
371
|
-
</div>
|
|
372
|
-
</div>
|
|
373
|
-
);
|
|
374
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import Image from 'next/image';
|
|
5
|
-
import { ShoppingCart, ExternalLink } from 'lucide-react';
|
|
6
|
-
|
|
7
|
-
import { ProductCardProps } from '../types';
|
|
8
|
-
|
|
9
|
-
function cleanProductDescription(raw: unknown): string {
|
|
10
|
-
if (raw === null || raw === undefined) return '';
|
|
11
|
-
|
|
12
|
-
const source = String(raw);
|
|
13
|
-
const bodyMatch = source.match(
|
|
14
|
-
/\bBody\s*\(HTML\)\s*:\s*([\s\S]*?)(?=\s*[,.]?\s+\b(?:Handle|Title|Vendor|Type|Tags|Published|Option\d*\s+Name|Option\d*\s+Value|Option|Variant|Image|SKU|Price|Status|Category)\b\s*:|$)/i,
|
|
15
|
-
);
|
|
16
|
-
const descriptionMatch = bodyMatch ?? source.match(
|
|
17
|
-
/\b(?:Description|Summary|Details|Body)\s*:\s*([\s\S]*?)(?=\s*[,.]?\s+\b(?:Handle|Title|Vendor|Type|Tags|Published|Option\d*\s+Name|Option\d*\s+Value|Option|Variant|Image|SKU|Price|Status|Category)\b\s*:|$)/i,
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
return (descriptionMatch?.[1] ?? source)
|
|
21
|
-
.replace(/<[^>]*>/g, ' ')
|
|
22
|
-
.replace(/ /gi, ' ')
|
|
23
|
-
.replace(/&/gi, '&')
|
|
24
|
-
.replace(/"/gi, '"')
|
|
25
|
-
.replace(/'/gi, "'")
|
|
26
|
-
.replace(/\[[^\]]*TYPE[^\]]*\]/gi, ' ')
|
|
27
|
-
.replace(/\b(?:Handle|Title|Vendor|Type|Tags|Published|Option\d*\s+Name|Option\d*\s+Value|Option|Variant|Image|SKU|Price|Status|Category)\s*:\s*[^,.\n:]+[,.]?/gi, ' ')
|
|
28
|
-
.replace(/\bBody\s*\(HTML\)\s*:\s*/gi, ' ')
|
|
29
|
-
.replace(/\b(?:Description|Summary|Details|Body|Content)\s*:\s*/gi, ' ')
|
|
30
|
-
.replace(/\s+/g, ' ')
|
|
31
|
-
.trim();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function ProductCard({ product, primaryColor = '#6366f1', onAddToCart }: ProductCardProps) {
|
|
35
|
-
const description = cleanProductDescription(product.description);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className="flex-shrink-0 w-full bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 group">
|
|
39
|
-
{/* Product Image */}
|
|
40
|
-
<div className="relative h-40 w-full bg-slate-100 dark:bg-white/5 flex items-center justify-center overflow-hidden">
|
|
41
|
-
{product.image ? (
|
|
42
|
-
<Image
|
|
43
|
-
src={product.image}
|
|
44
|
-
alt={product.name}
|
|
45
|
-
fill
|
|
46
|
-
unoptimized
|
|
47
|
-
className="object-cover group-hover:scale-105 transition-transform duration-500"
|
|
48
|
-
/>
|
|
49
|
-
) : (
|
|
50
|
-
<div className="text-slate-400 dark:text-white/20">
|
|
51
|
-
<ShoppingCart className="w-12 h-12" />
|
|
52
|
-
</div>
|
|
53
|
-
)}
|
|
54
|
-
|
|
55
|
-
{/* Brand Badge */}
|
|
56
|
-
{product.brand && (
|
|
57
|
-
<div className="absolute top-2 left-2 px-2 py-1 bg-white/90 dark:bg-black/60 backdrop-blur-md rounded-md text-[10px] font-bold uppercase tracking-wider text-slate-700 dark:text-white/90 shadow-sm">
|
|
58
|
-
{product.brand}
|
|
59
|
-
</div>
|
|
60
|
-
)}
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
{/* Product Info */}
|
|
64
|
-
<div className="p-4 flex flex-col gap-2">
|
|
65
|
-
<div className="flex justify-between items-start gap-2">
|
|
66
|
-
<h3 className="text-sm font-semibold text-slate-800 dark:text-white/90 line-clamp-1">
|
|
67
|
-
{product.name}
|
|
68
|
-
</h3>
|
|
69
|
-
{product.price && (
|
|
70
|
-
<span className="text-sm font-bold" style={{ color: primaryColor }}>
|
|
71
|
-
{typeof product.price === 'number'
|
|
72
|
-
? `$${product.price}`
|
|
73
|
-
: (String(product.price).match(/^[\d.]/) ? `$${product.price}` : product.price)}
|
|
74
|
-
</span>
|
|
75
|
-
)}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
{description && (
|
|
79
|
-
<p className="text-[11px] text-slate-500 dark:text-white/50 line-clamp-2 leading-relaxed">
|
|
80
|
-
{description}
|
|
81
|
-
</p>
|
|
82
|
-
)}
|
|
83
|
-
|
|
84
|
-
<div className="mt-2 flex gap-2">
|
|
85
|
-
<button
|
|
86
|
-
onClick={() => onAddToCart?.(product)}
|
|
87
|
-
className="flex-1 py-2 px-3 rounded-lg text-[11px] font-medium text-white shadow-sm hover:opacity-90 transition-opacity flex items-center justify-center gap-1.5"
|
|
88
|
-
style={{ background: primaryColor }}
|
|
89
|
-
>
|
|
90
|
-
<ShoppingCart className="w-3 h-3" />
|
|
91
|
-
Add to Cart
|
|
92
|
-
</button>
|
|
93
|
-
{product.link && (
|
|
94
|
-
<a
|
|
95
|
-
href={product.link}
|
|
96
|
-
target="_blank"
|
|
97
|
-
rel="noopener noreferrer"
|
|
98
|
-
className="p-2 rounded-lg bg-slate-100 dark:bg-white/10 text-slate-600 dark:text-white/70 hover:bg-slate-200 dark:hover:bg-white/20 transition-colors"
|
|
99
|
-
>
|
|
100
|
-
<ExternalLink className="w-3.5 h-3.5" />
|
|
101
|
-
</a>
|
|
102
|
-
)}
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useState, useEffect } from 'react';
|
|
4
|
-
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
5
|
-
import { ProductCard } from './ProductCard';
|
|
6
|
-
import { ProductCarouselProps } from '../types';
|
|
7
|
-
|
|
8
|
-
export function ProductCarousel({ products, primaryColor = '#6366f1', onAddToCart }: ProductCarouselProps) {
|
|
9
|
-
const scrollRef = useRef<HTMLDivElement>(null);
|
|
10
|
-
const [canScroll, setCanScroll] = useState(false);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const checkScroll = () => {
|
|
14
|
-
if (scrollRef.current) {
|
|
15
|
-
const hasOverflow = scrollRef.current.scrollWidth > scrollRef.current.clientWidth;
|
|
16
|
-
setCanScroll(hasOverflow);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Initial check
|
|
21
|
-
checkScroll();
|
|
22
|
-
|
|
23
|
-
// Set up ResizeObserver to handle chat window resizing
|
|
24
|
-
const observer = new ResizeObserver(checkScroll);
|
|
25
|
-
if (scrollRef.current) observer.observe(scrollRef.current);
|
|
26
|
-
|
|
27
|
-
return () => observer.disconnect();
|
|
28
|
-
}, [products]);
|
|
29
|
-
|
|
30
|
-
const scroll = (direction: 'left' | 'right') => {
|
|
31
|
-
if (scrollRef.current) {
|
|
32
|
-
const firstCard = scrollRef.current.firstElementChild as HTMLElement;
|
|
33
|
-
if (firstCard) {
|
|
34
|
-
// Use actual rendered width + gap
|
|
35
|
-
const cardWidth = firstCard.offsetWidth + 16;
|
|
36
|
-
const scrollAmount = direction === 'left' ? -cardWidth : cardWidth;
|
|
37
|
-
scrollRef.current.scrollBy({ left: scrollAmount, behavior: 'smooth' });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
if (!products || products.length === 0) return null;
|
|
43
|
-
|
|
44
|
-
// Single product: No carousel needed
|
|
45
|
-
if (products.length === 1) {
|
|
46
|
-
return (
|
|
47
|
-
<div className="my-4 w-[min(88%,18rem)] min-w-0 max-w-full animate-fade-in-up">
|
|
48
|
-
<ProductCard product={products[0]} primaryColor={primaryColor} onAddToCart={onAddToCart} />
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className="relative w-full my-4 group/carousel animate-fade-in-up">
|
|
55
|
-
{/* Scroll Buttons - Only show if there is overflow */}
|
|
56
|
-
{canScroll && (
|
|
57
|
-
<>
|
|
58
|
-
<div className="absolute -left-4 top-1/2 -translate-y-1/2 z-20 opacity-100 md:opacity-0 md:group-hover/carousel:opacity-100 transition-opacity">
|
|
59
|
-
<button
|
|
60
|
-
onClick={(e) => { e.stopPropagation(); scroll('left'); }}
|
|
61
|
-
className="p-2 rounded-full bg-white dark:bg-slate-800 shadow-xl border border-slate-200 dark:border-white/10 text-slate-600 dark:text-white/80 hover:text-indigo-500 dark:hover:text-indigo-400 transition-all hover:scale-110 active:scale-95"
|
|
62
|
-
aria-label="Scroll left"
|
|
63
|
-
>
|
|
64
|
-
<ChevronLeft className="w-5 h-5" />
|
|
65
|
-
</button>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div className="absolute -right-4 top-1/2 -translate-y-1/2 z-20 opacity-100 md:opacity-0 md:group-hover/carousel:opacity-100 transition-opacity">
|
|
69
|
-
<button
|
|
70
|
-
onClick={(e) => { e.stopPropagation(); scroll('right'); }}
|
|
71
|
-
className="p-2 rounded-full bg-white dark:bg-slate-800 shadow-xl border border-slate-200 dark:border-white/10 text-slate-600 dark:text-white/80 hover:text-indigo-500 dark:hover:text-indigo-400 transition-all hover:scale-110 active:scale-95"
|
|
72
|
-
aria-label="Scroll right"
|
|
73
|
-
>
|
|
74
|
-
<ChevronRight className="w-5 h-5" />
|
|
75
|
-
</button>
|
|
76
|
-
</div>
|
|
77
|
-
</>
|
|
78
|
-
)}
|
|
79
|
-
|
|
80
|
-
{/* Carousel Container */}
|
|
81
|
-
<div
|
|
82
|
-
ref={scrollRef}
|
|
83
|
-
className="flex gap-4 overflow-x-auto pb-4 px-1 scrollbar-hide snap-x snap-mandatory"
|
|
84
|
-
style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}
|
|
85
|
-
>
|
|
86
|
-
{products.map((product) => (
|
|
87
|
-
<div
|
|
88
|
-
key={product.id}
|
|
89
|
-
className="snap-start flex-shrink-0 w-[min(88%,18rem)] min-w-[11rem] max-w-full"
|
|
90
|
-
>
|
|
91
|
-
<ProductCard product={product} primaryColor={primaryColor} onAddToCart={onAddToCart} />
|
|
92
|
-
</div>
|
|
93
|
-
))}
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ChevronDown, ChevronUp } from 'lucide-react';
|
|
5
|
-
import { SourceCardProps } from '../types';
|
|
6
|
-
|
|
7
|
-
export function SourceCard({ source, index }: SourceCardProps) {
|
|
8
|
-
const [expanded, setExpanded] = React.useState(false);
|
|
9
|
-
const scorePercent = Math.round(source.score * 100);
|
|
10
|
-
|
|
11
|
-
const scoreColor =
|
|
12
|
-
source.score >= 0.8
|
|
13
|
-
? 'text-emerald-400'
|
|
14
|
-
: source.score >= 0.6
|
|
15
|
-
? 'text-amber-400'
|
|
16
|
-
: 'text-rose-400';
|
|
17
|
-
|
|
18
|
-
const scoreBg =
|
|
19
|
-
source.score >= 0.8
|
|
20
|
-
? 'bg-emerald-50 border-emerald-100 dark:bg-emerald-400/10 dark:border-emerald-400/20'
|
|
21
|
-
: source.score >= 0.6
|
|
22
|
-
? 'bg-amber-50 border-amber-100 dark:bg-amber-400/10 dark:border-amber-400/20'
|
|
23
|
-
: 'bg-rose-50 border-rose-100 dark:bg-rose-400/10 dark:border-rose-400/20';
|
|
24
|
-
|
|
25
|
-
const preview = source.content.slice(0, 120);
|
|
26
|
-
const hasMore = source.content.length > 120;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div
|
|
30
|
-
className={`rounded-xl border backdrop-blur-sm p-3 transition-all duration-200 hover:scale-[1.01] cursor-pointer ${scoreBg}`}
|
|
31
|
-
onClick={() => setExpanded((e) => !e)}
|
|
32
|
-
>
|
|
33
|
-
<div className="flex items-start justify-between gap-2">
|
|
34
|
-
<div className="flex items-center gap-2 min-w-0">
|
|
35
|
-
<span className="flex-shrink-0 w-5 h-5 rounded-full bg-slate-200 dark:bg-white/10 flex items-center justify-center text-[10px] font-bold text-slate-500 dark:text-white/60">
|
|
36
|
-
{index + 1}
|
|
37
|
-
</span>
|
|
38
|
-
<span className="text-xs text-slate-500 dark:text-white/50 truncate font-mono">
|
|
39
|
-
{(source.metadata?.docId as string) ?? source.id}
|
|
40
|
-
</span>
|
|
41
|
-
</div>
|
|
42
|
-
<span className={`flex-shrink-0 text-xs font-semibold ${scoreColor} tabular-nums`}>
|
|
43
|
-
{scorePercent}%
|
|
44
|
-
</span>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<p className="mt-2 text-xs text-slate-600 dark:text-white/70 leading-relaxed">
|
|
48
|
-
{expanded ? source.content : `${preview}${hasMore && !expanded ? '…' : ''}`}
|
|
49
|
-
</p>
|
|
50
|
-
|
|
51
|
-
{hasMore && (
|
|
52
|
-
<button className="mt-1 text-[10px] text-indigo-400 hover:text-indigo-300 transition-colors flex items-center gap-0.5">
|
|
53
|
-
{expanded
|
|
54
|
-
? <><ChevronUp className="w-3 h-3" /> Show less</>
|
|
55
|
-
: <><ChevronDown className="w-3 h-3" /> Show more</>
|
|
56
|
-
}
|
|
57
|
-
</button>
|
|
58
|
-
)}
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
|
5
|
-
|
|
6
|
-
export function ThemeProvider({ children, ...props }: React.ComponentProps<typeof NextThemesProvider>) {
|
|
7
|
-
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
|
8
|
-
}
|