From effed6d9ff6c684282173b1caf722770134de6d5 Mon Sep 17 00:00:00 2001 From: Sebastian Tilsch Date: Mon, 3 Jun 2024 12:49:46 +0200 Subject: [PATCH] add List Item to advanced components --- apps/exhibition-live/components/google/SpreadSheetView.tsx | 4 ++-- .../advanced-components/src/show/SimpleListItem.tsx | 6 ++---- packages/advanced-components/src/show/index.ts | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) rename apps/exhibition-live/components/content/list/TypedListItem.tsx => packages/advanced-components/src/show/SimpleListItem.tsx (93%) diff --git a/apps/exhibition-live/components/google/SpreadSheetView.tsx b/apps/exhibition-live/components/google/SpreadSheetView.tsx index 7521e6c7..98feb497 100644 --- a/apps/exhibition-live/components/google/SpreadSheetView.tsx +++ b/apps/exhibition-live/components/google/SpreadSheetView.tsx @@ -50,7 +50,6 @@ import { import { encodeIRI, filterUndefOrNull } from "@slub/edb-ui-utils"; import { useQuery } from "@slub/edb-state-hooks"; import { OwnColumnDesc } from "./types"; -import TypedListItem from "../content/list/TypedListItem"; import HorizontalNonLinearStepper from "../form/wizard/HorizontalNonLinearStepper"; import { useCRUDWithQueryClient, @@ -68,6 +67,7 @@ import { DeclarativeMatchBasedFlatMappings, } from "@slub/edb-ui-utils"; import { CRUDFunctions } from "@slub/edb-core-types"; +import { SimpleListItem } from "@slub/edb-advanced-components"; //we will create a cashed worksheet, were selectively rows are preloaded and once loaded use for a certain stale time type CachedWorkSheet = { @@ -454,7 +454,7 @@ const MappedItem = ({ ) : ( {data?.["@type"] && ( - + )} ); diff --git a/apps/exhibition-live/components/content/list/TypedListItem.tsx b/packages/advanced-components/src/show/SimpleListItem.tsx similarity index 93% rename from apps/exhibition-live/components/content/list/TypedListItem.tsx rename to packages/advanced-components/src/show/SimpleListItem.tsx index a689f58e..b9fd6e57 100644 --- a/apps/exhibition-live/components/content/list/TypedListItem.tsx +++ b/packages/advanced-components/src/show/SimpleListItem.tsx @@ -16,9 +16,9 @@ interface OwnProps { disableLoad?: boolean; } -type Props = OwnProps; +export type TypedListItemProps = OwnProps; -const TypedListItem: FunctionComponent = ({ +export const SimpleListItem: FunctionComponent = ({ index, data, disableLoad, @@ -67,5 +67,3 @@ const TypedListItem: FunctionComponent = ({ ); }; - -export default TypedListItem; diff --git a/packages/advanced-components/src/show/index.ts b/packages/advanced-components/src/show/index.ts index 2bf8b097..3b1f4edb 100644 --- a/packages/advanced-components/src/show/index.ts +++ b/packages/advanced-components/src/show/index.ts @@ -3,3 +3,4 @@ export * from "./EntityDetailCard"; export * from "./EntityDetailElement"; export * from "./EntityDetailListItem"; export * from "./EntityDetailModal"; +export * from "./SimpleListItem";