A lexicon-driven AppView for ATProto.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132import type { Column } from "@tanstack/react-table";
export function getColumnPinningStyle<TData>({ column, withBorder = false,}: { column: Column<TData>; withBorder?: boolean;}): React.CSSProperties { const isPinned = column.getIsPinned(); const isLastLeftPinnedColumn = isPinned === "left" && column.getIsLastColumn("left"); const isFirstRightPinnedColumn = isPinned === "right" && column.getIsFirstColumn("right");
return { boxShadow: withBorder ? isLastLeftPinnedColumn ? "-4px 0 4px -4px var(--border) inset" : isFirstRightPinnedColumn ? "4px 0 4px -4px var(--border) inset" : undefined : undefined, left: isPinned === "left" ? `${column.getStart("left")}px` : undefined, right: isPinned === "right" ? `${column.getAfter("right")}px` : undefined, position: isPinned ? "sticky" : "relative", width: isPinned ? "1%" : column.getSize(), zIndex: isPinned ? 1 : undefined, };}