From dc1ad36cc9795117e657fea8cd6a77e1c12d6228 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 23 May 2023 22:53:43 -0500 Subject: [PATCH] PropertyList with composed React subcomponents implementation --- src/components/common/PropertyList.tsx | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/components/common/PropertyList.tsx diff --git a/src/components/common/PropertyList.tsx b/src/components/common/PropertyList.tsx new file mode 100644 index 0000000..96b37c7 --- /dev/null +++ b/src/components/common/PropertyList.tsx @@ -0,0 +1,34 @@ +import React, { FunctionComponent, ReactNode } from "react"; +import Property from "@/components/common/Property"; + +const PropertyListItem: FunctionComponent<{ + title: string; + children: string; +}> = ({ title, children }) => { + return ( +
  • + {children} +
  • + ); +}; + +type PropertyListProps = { + title: string; + children: ReactNode; +}; + +const PropertyList: FunctionComponent & { + Item: typeof PropertyListItem; +} = ({ title, children }) => { + return ( + +
      + {children} +
    +
    + ); +}; + +PropertyList.Item = PropertyListItem; + +export default PropertyList;