forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReceiptImage.tsx
More file actions
39 lines (36 loc) · 1.49 KB
/
Copy pathReceiptImage.tsx
File metadata and controls
39 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { FileText } from 'lucide-react';
interface ReceiptImageProps {
imageUrl?: string;
onView?: () => void;
}
export const ReceiptImage = ({ imageUrl, onView }: ReceiptImageProps) => {
if (!imageUrl) return null;
return (
<div className="mt-4 mb-6">
<div
onClick={onView}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onView?.();
}
}}
role="button"
tabIndex={0}
aria-label="View full receipt"
className="relative h-48 w-full bg-gray-100 rounded-xl overflow-hidden cursor-pointer group border border-gray-200 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2"
>
<img
src={imageUrl}
alt="Receipt"
className="w-full h-full object-cover group-hover:opacity-90 transition-opacity"
/>
<div className="absolute inset-0 flex items-center justify-center bg-black/20 opacity-0 group-hover:opacity-100 transition-opacity">
<span className="text-white font-medium flex items-center gap-2 bg-black/50 px-4 py-2 rounded-lg backdrop-blur-sm">
<FileText size={20} /> View Receipt
</span>
</div>
</div>
</div>
);
};