forked from oyeolamilekan/appshots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenContent.tsx
More file actions
43 lines (40 loc) · 1.05 KB
/
Copy pathScreenContent.tsx
File metadata and controls
43 lines (40 loc) · 1.05 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
40
41
42
43
/**
* ScreenContent Component
*
* Renders the content displayed on the device screen.
* Shows either the uploaded screenshot or a placeholder message.
*/
interface ScreenContentProps {
/** URL of the screenshot image, or null if no image is uploaded */
screenshotSrc: string | null;
}
/**
* Displays the device screen content.
*
* @param props - Component props
* @param props.screenshotSrc - The screenshot image URL or null
*
* @example
* // With an image
* <ScreenContent screenshotSrc="https://example.com/screenshot.png" />
*
* @example
* // Without an image (shows placeholder)
* <ScreenContent screenshotSrc={null} />
*/
export const ScreenContent = ({ screenshotSrc }: ScreenContentProps) => {
if (screenshotSrc) {
return (
<img
src={screenshotSrc}
alt="Screenshot"
className="w-full h-full object-fill"
/>
);
}
return (
<div className="w-full h-full flex items-center justify-center bg-[#1c1c1e]">
<span className="text-gray-600 text-[10px]">No image</span>
</div>
);
};