import type { ReactNode } from "react"; import { isElectron } from "~/env"; import { cn } from "~/lib/utils"; import { Skeleton } from "./ui/skeleton"; export type DiffPanelMode = "inline" | "sheet" | "sidebar"; function getDiffPanelHeaderRowClassName(mode: DiffPanelMode) { const shouldUseDragRegion = isElectron && mode !== "sheet"; return cn( "flex items-center justify-between gap-2 px-4", shouldUseDragRegion ? "drag-region h-[52px] border-b border-border wco:h-[env(titlebar-area-height)] wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]" : "h-12 wco:max-h-[env(titlebar-area-height)]", ); } export function DiffPanelShell(props: { mode: DiffPanelMode; header: ReactNode; children: ReactNode; }) { const shouldUseDragRegion = isElectron && props.mode !== "sheet"; return (
{shouldUseDragRegion ? (
{props.header}
) : (
{props.header}
)} {props.children}
); } export function DiffPanelHeaderSkeleton() { return ( <>
); } export function DiffPanelLoadingState(props: { label: string }) { return (
{props.label}
); }