2022-11-22 13:00:55 +00:00
|
|
|
import clsx from 'clsx';
|
2022-05-09 21:01:15 +00:00
|
|
|
import { ReactNode } from 'react';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
children?: ReactNode;
|
|
|
|
label: string;
|
2022-11-22 13:00:55 +00:00
|
|
|
colClassName?: string;
|
|
|
|
className?: string;
|
2022-05-09 21:01:15 +00:00
|
|
|
}
|
|
|
|
|
2022-11-22 13:00:55 +00:00
|
|
|
export function DetailsRow({
|
|
|
|
label,
|
|
|
|
children,
|
|
|
|
colClassName,
|
|
|
|
className,
|
|
|
|
}: Props) {
|
2022-05-09 21:01:15 +00:00
|
|
|
return (
|
2022-11-22 13:00:55 +00:00
|
|
|
<tr className={className}>
|
2023-02-12 21:04:24 +00:00
|
|
|
<td className={clsx(colClassName, 'min-w-[150px] !break-normal')}>
|
2022-11-22 13:00:55 +00:00
|
|
|
{label}
|
|
|
|
</td>
|
2023-05-02 06:42:16 +00:00
|
|
|
{!!children && (
|
2022-11-22 13:00:55 +00:00
|
|
|
<td className={colClassName} data-cy={`detailsTable-${label}Value`}>
|
|
|
|
{children}
|
|
|
|
</td>
|
|
|
|
)}
|
2022-05-09 21:01:15 +00:00
|
|
|
</tr>
|
|
|
|
);
|
|
|
|
}
|