import{an as j,j as e,ap as h,Q as p,q as i}from"./index-Dbk1Plmn.js";import{a as u}from"./use_timeline-DHzluypB.js";import{P as r}from"./page_shell-C0CL85dt.js";import{C as n,a,b as d,c as l}from"./card-CfjWPSFY.js";import{E as f}from"./entity_link-qYsgSBpl.js";import{S as v}from"./source_link-Bg790zHv.js";import{J as N}from"./json_viewer-ClIBr-BE.js";import{s as y,a as g}from"./query_loading-BFETHugg.js";import{Q as E}from"./query_refresh_indicator-1_XqkpX1.js";import"./timeline-B_D7qsoU.js";import"./chevron-right-L2MnFoxW.js";import"./chevron-down-BMaycUN9.js";function R(){var o,c;const{id:x}=j(),t=u(x),s=(o=t.data)==null?void 0:o.event;return y(t)?e.jsx(r,{title:"Loading…",children:e.jsx(h,{})}):t.error?e.jsx(r,{title:"Error",children:e.jsx(p,{title:"Could not load event",children:t.error.message})}):s?e.jsxs(r,{title:s.event_type||"Event",description:`Timeline Event · ${i(s.event_timestamp)}`,actions:g(t)?e.jsx(E,{}):void 0,children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(n,{children:[e.jsx(a,{children:e.jsx(d,{className:"text-base",children:"Details"})}),e.jsxs(l,{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"ID"}),e.jsx("span",{className:"font-mono text-xs",children:s.id})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Type"}),e.jsx("span",{children:s.event_type||"—"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Event date"}),e.jsx("span",{children:i(s.event_timestamp)})]}),s.created_at&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Indexed at"}),e.jsx("span",{children:i(s.created_at)})]}),s.source_id&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Source"}),e.jsx(v,{id:s.source_id})]})]})]}),e.jsxs(n,{children:[e.jsx(a,{children:e.jsx(d,{className:"text-base",children:"Linked Entities"})}),e.jsx(l,{children:s.entity_id||(c=s.entity_ids)!=null&&c.length?e.jsx("div",{className:"space-y-1",children:(s.entity_id?[s.entity_id]:s.entity_ids??[]).map(m=>e.jsx("div",{children:e.jsx(f,{id:m})},m))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No linked entities."})})]})]}),s.properties&&Object.keys(s.properties).length>0&&e.jsxs(n,{className:"mt-4",children:[e.jsx(a,{children:e.jsx(d,{className:"text-base",children:"Properties"})}),e.jsx(l,{children:e.jsx(N,{data:s.properties,defaultExpanded:!0})})]})]}):e.jsx(r,{title:"Not Found",children:e.jsx("div",{className:"text-muted-foreground",children:"Event not found."})})}export{R as default};
