Files
homarr/apps/nextjs/src/components/board/sections/grid/grid-entry-memo.ts
T

26 lines
1.0 KiB
TypeScript

import type { SectionGridPlacement } from "./use-grid-layout-actions";
export interface DndGridEntryProps {
sectionId: string;
placement: SectionGridPlacement;
label: string;
columnCount: number;
maxRowCount: number | null;
registerElement: (id: string, element: HTMLElement | null) => void;
}
export const areDndGridEntryPropsEqual = (previous: DndGridEntryProps, next: DndGridEntryProps) =>
previous.sectionId === next.sectionId &&
previous.label === next.label &&
previous.columnCount === next.columnCount &&
previous.maxRowCount === next.maxRowCount &&
previous.registerElement === next.registerElement &&
previous.placement.id === next.placement.id &&
previous.placement.type === next.placement.type &&
previous.placement.x === next.placement.x &&
previous.placement.y === next.placement.y &&
previous.placement.w === next.placement.w &&
previous.placement.h === next.placement.h &&
previous.placement.minW === next.placement.minW &&
previous.placement.minH === next.placement.minH;