3f255ea201
Extract shared vision/document analysis logic into lib/ai (vision-client, document-analyzer, image preprocessing, validation helpers), simplifying invoice-analyzer, receipt-analyzer, and document classifier. Add migration 046 for journal entry reversal/correction link columns (reversed_by_id, reverses_id, correction_of_id) required by storno service. Update extension components and shared UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
'use client'
|
|
|
|
import type { ExtensionDefinition } from '@/lib/extensions/types'
|
|
import { getSector } from '@/lib/extensions/sectors'
|
|
import { resolveIcon } from '@/lib/extensions/icon-resolver'
|
|
import Link from 'next/link'
|
|
|
|
export default function ExtensionWorkspaceShell({
|
|
definition,
|
|
children,
|
|
}: {
|
|
definition: ExtensionDefinition
|
|
children: React.ReactNode
|
|
}) {
|
|
const Icon = resolveIcon(definition.icon)
|
|
const sector = getSector(definition.sector)
|
|
|
|
return (
|
|
<div>
|
|
{/* Breadcrumb */}
|
|
<nav className="flex items-center gap-1.5 text-sm text-muted-foreground mb-6">
|
|
<Link href="/extensions" className="hover:text-foreground transition-colors">
|
|
Tillägg
|
|
</Link>
|
|
<span>/</span>
|
|
<Link
|
|
href={`/extensions/${definition.sector}`}
|
|
className="hover:text-foreground transition-colors"
|
|
>
|
|
{sector?.name ?? definition.sector}
|
|
</Link>
|
|
<span>/</span>
|
|
<span className="text-foreground">{definition.name}</span>
|
|
</nav>
|
|
|
|
{/* Header */}
|
|
<div className="flex items-start gap-4 mb-8">
|
|
<div className="flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 flex-shrink-0">
|
|
<Icon className="h-6 w-6 text-primary" />
|
|
</div>
|
|
<div>
|
|
<h1 className="text-xl font-semibold tracking-tight">{definition.name}</h1>
|
|
<p className="text-sm text-muted-foreground mt-0.5">{definition.description}</p>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Extension content */}
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|