Docs: Update MIGRATION_PLAN.md to v0.4.0 with new features (Company Explorer)
This commit is contained in:
@@ -55,6 +55,8 @@ export function Inspector({ companyId, onClose, apiBase }: InspectorProps) {
|
||||
const [wikiUrlInput, setWikiUrlInput] = useState("")
|
||||
const [isEditingWebsite, setIsEditingWebsite] = useState(false)
|
||||
const [websiteInput, setWebsiteInput] = useState("")
|
||||
const [isEditingImpressum, setIsEditingImpressum] = useState(false)
|
||||
const [impressumUrlInput, setImpressumUrlInput] = useState("")
|
||||
|
||||
const fetchData = (silent = false) => {
|
||||
if (!companyId) return
|
||||
@@ -84,6 +86,7 @@ export function Inspector({ companyId, onClose, apiBase }: InspectorProps) {
|
||||
fetchData()
|
||||
setIsEditingWiki(false)
|
||||
setIsEditingWebsite(false)
|
||||
setIsEditingImpressum(false)
|
||||
setIsProcessing(false) // Reset on ID change
|
||||
}, [companyId])
|
||||
|
||||
@@ -173,6 +176,21 @@ export function Inspector({ companyId, onClose, apiBase }: InspectorProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const handleImpressumOverride = async () => {
|
||||
if (!companyId) return
|
||||
setIsProcessing(true)
|
||||
try {
|
||||
await axios.post(`${apiBase}/companies/${companyId}/override/impressum?url=${encodeURIComponent(impressumUrlInput)}`)
|
||||
setIsEditingImpressum(false)
|
||||
fetchData()
|
||||
} catch (e) {
|
||||
alert("Impressum update failed")
|
||||
console.error(e)
|
||||
} finally {
|
||||
setIsProcessing(false)
|
||||
}
|
||||
}
|
||||
|
||||
if (!companyId) return null
|
||||
|
||||
const wikiEntry = data?.enrichment_data?.find(e => e.source_type === 'wikipedia')
|
||||
@@ -304,43 +322,90 @@ export function Inspector({ companyId, onClose, apiBase }: InspectorProps) {
|
||||
<div className="p-6 space-y-8">
|
||||
|
||||
{/* Impressum / Legal Data (NEW) */}
|
||||
{impressum && (
|
||||
<div className="bg-slate-950 rounded-lg p-4 border border-slate-800 flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="p-1 bg-slate-800 rounded text-slate-400">
|
||||
<Briefcase className="h-3 w-3" />
|
||||
</div>
|
||||
<span className="text-[10px] uppercase font-bold text-slate-500 tracking-wider">Official Legal Data</span>
|
||||
<div className="bg-slate-950 rounded-lg p-4 border border-slate-800 flex flex-col gap-2">
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="p-1 bg-slate-800 rounded text-slate-400">
|
||||
<Briefcase className="h-3 w-3" />
|
||||
</div>
|
||||
<span className="text-[10px] uppercase font-bold text-slate-500 tracking-wider">Official Legal Data</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
{scrapeDate && (
|
||||
<div className="text-[10px] text-slate-600 flex items-center gap-1">
|
||||
<Clock className="h-3 w-3" /> {new Date(scrapeDate).toLocaleDateString()}
|
||||
</div>
|
||||
)}
|
||||
{!isEditingImpressum ? (
|
||||
<button
|
||||
onClick={() => { setImpressumUrlInput(""); setIsEditingImpressum(true); }}
|
||||
className="p-1 text-slate-600 hover:text-white transition-colors"
|
||||
title="Set Impressum URL Manually"
|
||||
>
|
||||
<Pencil className="h-3 w-3" />
|
||||
</button>
|
||||
) : (
|
||||
<div className="flex items-center gap-1 animate-in fade-in zoom-in duration-200">
|
||||
<button
|
||||
onClick={handleImpressumOverride}
|
||||
className="p-1 bg-green-900/50 text-green-400 rounded hover:bg-green-900 transition-colors"
|
||||
>
|
||||
<Check className="h-3 w-3" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setIsEditingImpressum(false)}
|
||||
className="p-1 text-slate-500 hover:text-red-400 transition-colors"
|
||||
>
|
||||
<X className="h-3 w-3" />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="text-sm font-medium text-white">
|
||||
{impressum.legal_name || "Unknown Legal Name"}
|
||||
</div>
|
||||
|
||||
<div className="flex items-start gap-2 text-xs text-slate-400">
|
||||
<MapPin className="h-3 w-3 mt-0.5 shrink-0" />
|
||||
<div>
|
||||
<div>{impressum.street}</div>
|
||||
<div>{impressum.zip} {impressum.city}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(impressum.email || impressum.phone) && (
|
||||
<div className="mt-2 pt-2 border-t border-slate-900 flex flex-wrap gap-4 text-[10px] text-slate-500 font-mono">
|
||||
{impressum.email && <span>{impressum.email}</span>}
|
||||
{impressum.phone && <span>{impressum.phone}</span>}
|
||||
{impressum.vat_id && <span className="text-blue-400/80">VAT: {impressum.vat_id}</span>}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isEditingImpressum && (
|
||||
<div className="mb-2 animate-in slide-in-from-top-1 duration-200">
|
||||
<input
|
||||
type="text"
|
||||
value={impressumUrlInput}
|
||||
onChange={e => setImpressumUrlInput(e.target.value)}
|
||||
placeholder="https://.../impressum"
|
||||
className="w-full bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs text-white focus:ring-1 focus:ring-blue-500 outline-none"
|
||||
autoFocus
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{impressum ? (
|
||||
<>
|
||||
<div className="text-sm font-medium text-white">
|
||||
{impressum.legal_name || "Unknown Legal Name"}
|
||||
</div>
|
||||
|
||||
<div className="flex items-start gap-2 text-xs text-slate-400">
|
||||
<MapPin className="h-3 w-3 mt-0.5 shrink-0" />
|
||||
<div>
|
||||
<div>{impressum.street}</div>
|
||||
<div>{impressum.zip} {impressum.city}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{(impressum.email || impressum.phone) && (
|
||||
<div className="mt-2 pt-2 border-t border-slate-900 flex flex-wrap gap-4 text-[10px] text-slate-500 font-mono">
|
||||
{impressum.email && <span>{impressum.email}</span>}
|
||||
{impressum.phone && <span>{impressum.phone}</span>}
|
||||
{impressum.vat_id && <span className="text-blue-400/80">VAT: {impressum.vat_id}</span>}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
) : !isEditingImpressum && (
|
||||
<div className="text-[10px] text-slate-600 italic py-2">
|
||||
No legal data found. Click pencil to provide direct Impressum link.
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{/* AI Analysis Dossier (NEW) */}
|
||||
{aiAnalysis && (
|
||||
|
||||
Reference in New Issue
Block a user