Skip to content

Commit

Permalink
fix: remove extra handler
Browse files Browse the repository at this point in the history
  • Loading branch information
mournfulCoroner committed Jan 15, 2025
1 parent 339732d commit 259e4fa
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/components/FilePreview/FilePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,14 @@ export function FilePreview({
const isPreviewString = typeof previewSrc === 'string';
const hideActions = isPreviewString && mobile;

const handleClick: React.MouseEventHandler<HTMLDivElement> = React.useCallback(
(e) => {
onClick?.(e);
},
[onClick],
);

return (
<div className={cn(null, className)} data-qa={qa}>
<div
className={cn('card', {clickable, hoverable: clickable || withActions})}
role={clickable ? 'button' : undefined}
onKeyDown={clickable ? onKeyDown : undefined}
tabIndex={clickable ? 0 : undefined}
onClick={clickable ? handleClick : undefined}
onClick={onClick}
>
{isPreviewString ? (
<div className={cn('image-container')}>
Expand Down

0 comments on commit 259e4fa

Please sign in to comment.