'use client'; import { FC, MouseEvent } from 'react'; import Link from 'next/link'; import { useMutateShowState } from '@/hooks/useShowState'; interface Props { show: Show; href?: string; onClick?: () => void; } const Handlers: FC = ({ href, onClick, show }) => { const { mutate } = useMutateShowState(show); const handleClick = (event: MouseEvent) => { if (!onClick) return; if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return; event.preventDefault(); onClick(); }; const handlers = { onClick: handleClick, onDoubleClick: () => mutate({ list: 'favorite', value: true }), className: 'absolute left-0 top-0 size-full' }; if (!href) return
; return ; }; export default Handlers;