UNPKG

alinea

Version:
25 lines (23 loc) 1 kB
import "../../chunks/chunk-NZLE2WMY.js"; // src/picker/entry/EntryPickerRow.tsx import { getType } from "alinea/core/Internal"; import { resolveView } from "alinea/core/View"; import { useConfig } from "alinea/dashboard/hook/UseConfig"; import { useDashboard } from "alinea/dashboard/hook/UseDashboard"; import { useEntrySummary } from "alinea/dashboard/hook/UseEntrySummary"; import { EntrySummaryRow } from "alinea/dashboard/view/entry/EntrySummary"; import { EntryReference } from "./EntryReference.js"; import { jsx } from "react/jsx-runtime"; function EntryPickerRow({ reference }) { const { views } = useDashboard(); const entry = useEntrySummary(reference[EntryReference.entry]); const { schema } = useConfig(); if (!entry) return null; const type = schema[entry.type]; const typeView = type && getType(type).summaryRow; const View = (typeView && resolveView(views, typeView)) ?? EntrySummaryRow; return /* @__PURE__ */ jsx(View, { ...entry }); } export { EntryPickerRow };