Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

903 B
Raw Blame
import type { ReactNode } from "react";

type Props = {
  readonly title?: string;
  readonly titleSlot?: ReactNode;
  readonly children: ReactNode;
};

/**
 * A 2-column grid row: gray title on the left, value (right-aligned,
 * ellipsis on overflow) on the right.
 *
 * `grid-template-columns: auto 1fr` + 16px gap so the title hugs its
 * content and the value column truncates.
 */
export function InfoItem({ title, titleSlot, children }: Props) {
  return (
    <div
      className="w-full grid gap-x-4 items-center"
      style={{ gridTemplateColumns: "auto 1fr" }}
    >
      <div className="text-control-light font-medium whitespace-nowrap">
        {titleSlot ?? title}
      </div>
      <div className="text-right flex items-center justify-end min-w-0">
        <span className="truncate flex h-5 items-center leading-5">
          {children}
        </span>
      </div>
    </div>
  );
}