github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/layout/Grid/index.tsx (about)

     1  import { classNames } from "../../../../utils/styles";
     2  import { Dispatch, MouseEventHandler, ReactNode, SetStateAction } from "react";
     3  import { getResponsivePanelWidthClass } from "../../../../utils/layout";
     4  
     5  type GridEvents = {
     6    [name: string]: MouseEventHandler<HTMLDivElement>;
     7  };
     8  
     9  type GridProps = {
    10    children: ReactNode;
    11    className?: string;
    12    name: string;
    13    width?: number;
    14    events?: GridEvents;
    15    setRef?: Dispatch<SetStateAction<null>>;
    16  };
    17  
    18  const Grid = ({
    19    children,
    20    className,
    21    name,
    22    width,
    23    events,
    24    setRef,
    25  }: GridProps) => (
    26    <div
    27      // @ts-ignore
    28      ref={setRef}
    29      id={name}
    30      className={classNames(
    31        className,
    32        "grid grid-cols-12 col-span-12 gap-x-4 gap-y-4 md:gap-y-6 auto-rows-min",
    33        getResponsivePanelWidthClass(width)
    34      )}
    35      {...events}
    36    >
    37      {children}
    38    </div>
    39  );
    40  
    41  export default Grid;