2024-02-08 16:56:32 +00:00
|
|
|
import React from "react";
|
2024-05-10 15:18:24 +00:00
|
|
|
import classnames from "classnames";
|
2024-02-08 16:56:32 +00:00
|
|
|
|
|
|
|
|
const baseClass = "data-set";
|
|
|
|
|
|
|
|
|
|
interface IDataSetProps {
|
|
|
|
|
title: React.ReactNode;
|
|
|
|
|
value: React.ReactNode;
|
2025-02-21 11:52:41 +00:00
|
|
|
orientation?: "horizontal" | "vertical";
|
2024-05-10 15:18:24 +00:00
|
|
|
className?: string;
|
2024-02-08 16:56:32 +00:00
|
|
|
}
|
|
|
|
|
|
2025-02-21 11:52:41 +00:00
|
|
|
const DataSet = ({
|
|
|
|
|
title,
|
|
|
|
|
value,
|
|
|
|
|
orientation = "vertical",
|
|
|
|
|
className,
|
|
|
|
|
}: IDataSetProps) => {
|
|
|
|
|
const classNames = classnames(baseClass, className, {
|
|
|
|
|
[`${baseClass}__horizontal`]: orientation === "horizontal",
|
|
|
|
|
});
|
2024-05-10 15:18:24 +00:00
|
|
|
|
2024-02-08 16:56:32 +00:00
|
|
|
return (
|
2024-05-10 15:18:24 +00:00
|
|
|
<div className={classNames}>
|
2025-02-21 11:52:41 +00:00
|
|
|
<dt>
|
|
|
|
|
{title}
|
|
|
|
|
{orientation === "horizontal" && ":"}
|
|
|
|
|
</dt>
|
2024-02-08 16:56:32 +00:00
|
|
|
<dd>{value}</dd>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default DataSet;
|