- Replace all rgba(6,182,212,...) cyan focus borders and accents with rgba(249,115,22,...) ember orange across 21+ component files - Remove all var(--glass-border) references (undefined variable) with var(--color-border-default) across 24 files - Remove deprecated blur orbs and glass-morphism effects from SurveyPage, SurveyThankYouPage, and LoginPage - Migrate landing.css from hardcoded hex to CSS custom properties (~97 replacements for single-source theming) - Fix off-palette grays in FlowPilotAnalyticsPage chart styling (#8891a0 → #848b9b, #18191f → var(--color-bg-card)) - Update stale comments: "cyan brand" → "accent brand" in GlowEdge, "gradient cyan square" → "gradient orange square" in BrandLogo - Rename glow-cyan SVG filter ID to glow-accent - Fix category color comment: "cyan" → "deep orange" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import { useMemo } from 'react'
|
|
import { FileText } from 'lucide-react'
|
|
|
|
interface SourcePanelProps {
|
|
sourceText: string
|
|
sourceFormat: string
|
|
highlightExcerpt: string | null
|
|
}
|
|
|
|
export function SourcePanel({ sourceText, sourceFormat, highlightExcerpt }: SourcePanelProps) {
|
|
const renderedText = useMemo(() => {
|
|
if (!highlightExcerpt || !sourceText.includes(highlightExcerpt)) {
|
|
return <span>{sourceText}</span>
|
|
}
|
|
|
|
const idx = sourceText.indexOf(highlightExcerpt)
|
|
return (
|
|
<>
|
|
<span>{sourceText.slice(0, idx)}</span>
|
|
<mark className="bg-primary/20 text-foreground rounded px-0.5">{highlightExcerpt}</mark>
|
|
<span>{sourceText.slice(idx + highlightExcerpt.length)}</span>
|
|
</>
|
|
)
|
|
}, [sourceText, highlightExcerpt])
|
|
|
|
return (
|
|
<div className="card-flat flex flex-col h-full">
|
|
<div className="flex items-center gap-2 px-4 py-3 border-b" style={{ borderColor: 'var(--color-border-default)' }}>
|
|
<FileText size={16} className="text-muted-foreground" />
|
|
<span className="text-sm font-medium text-foreground">Source Document</span>
|
|
<span className="font-sans text-xs text-[0.625rem] uppercase tracking-[0.1em] text-muted-foreground ml-auto">
|
|
{sourceFormat}
|
|
</span>
|
|
</div>
|
|
<div className="flex-1 overflow-y-auto p-4">
|
|
<pre className="text-sm text-muted-foreground whitespace-pre-wrap font-sans leading-relaxed">
|
|
{renderedText}
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|