import { Row } from "@tanstack/react-table" import { type PropsWithChildren, useCallback } from 'react' import { type ColumnActions } from "@marzneshin/features/entity-table"; interface NoPropogationButtonProps { actions: ColumnActions, row: Row, } export function NoPropogationButton({ children, actions, row }: NoPropogationButtonProps & PropsWithChildren) { const handleKeyDown = useCallback((e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); e.stopPropagation(); actions.onOpen(row.original); } }, [actions, row.original]); return (
e.stopPropagation()} onKeyDown={handleKeyDown} tabIndex={0} role="button" > {children}
) }