import { Row } from "@tanstack/react-table";
import { Row as MRow } from "~/pages/traces/types";

export const calcPadding = (row: Row<MRow>): { containerPadding: string; linkPadding: string } => {
  const depth = row.original.depth;
  const hasSubRows = !!row.original.subRows.length;

  const containerPadding = depth >= 2 ? `${depth * 16}px` : "0px";
  const linkPadding = hasSubRows ? "0px" : "8px";

  return { containerPadding, linkPadding };
};
