import { Box } from "@mantine/core";
import type { ReactNode } from "react";

/**
 * Wrap inline row actions that open Mantine modals. Modals portal to document
 * body but React synthetic events still bubble through the component tree —
 * without this, clicks inside the modal can trigger a parent row's navigate.
 */
export function ModalSafeWrapper({ children }: { children: ReactNode }) {
  return (
    <Box component="span" onClick={(e) => e.stopPropagation()}>
      {children}
    </Box>
  );
}
