Files
probo/packages/ui/src/Atoms/PropertyRow/PropertyRow.tsx
Jonathan 3d4ecf5f8f Add risk creation form
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
2025-06-13 13:23:39 -07:00

30 lines
887 B
TypeScript

import { Children, type ReactNode } from "react";
import { Label } from "../Label/Label";
type Props = {
label: string;
id: string;
children: ReactNode;
error?: string;
};
export function PropertyRow({ id, label, children, error, ...props }: Props) {
const [firstChild, ...restChildren] = Children.toArray(children);
return (
<div className="py-3 border-b border-border-low space-y-2" {...props}>
<div className="flex items-center justify-between">
<Label
className="text-sm text-txt-secondary font-medium mb-0"
htmlFor={id}
>
{label}
</Label>
<div>{firstChild}</div>
</div>
{error && <div className="text-xs text-txt-danger">{error}</div>}
{restChildren}
</div>
);
}