admin/lib/isPlainPrimaryClick.ts
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

14 lines
487 B
TypeScript

import type { MouseEvent as ReactMouseEvent } from 'react'
/**
* True for a normal primary click that should open an in-page overlay.
* Modifier / non-primary clicks keep native link behavior (new tab, etc.).
*/
export const isPlainPrimaryClick = (event: ReactMouseEvent | MouseEvent): boolean => {
if (event.defaultPrevented) return false
if (event.button !== 0) return false
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return false
return true
}