mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-08 02:08:15 -06:00
PropertyList with composed React subcomponents implementation
This commit is contained in:
34
src/components/common/PropertyList.tsx
Normal file
34
src/components/common/PropertyList.tsx
Normal file
@@ -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 (
|
||||||
|
<li>
|
||||||
|
<span title={title}>{children}</span>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
type PropertyListProps = {
|
||||||
|
title: string;
|
||||||
|
children: ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
const PropertyList: FunctionComponent<PropertyListProps> & {
|
||||||
|
Item: typeof PropertyListItem;
|
||||||
|
} = ({ title, children }) => {
|
||||||
|
return (
|
||||||
|
<Property title={title}>
|
||||||
|
<ul key={2} className="list-disc">
|
||||||
|
{children}
|
||||||
|
</ul>
|
||||||
|
</Property>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
PropertyList.Item = PropertyListItem;
|
||||||
|
|
||||||
|
export default PropertyList;
|
||||||
Reference in New Issue
Block a user