-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating The ScanList.tsx and ScanViewer.tsx
- Loading branch information
1 parent
b32f101
commit 2ec96e6
Showing
2 changed files
with
63 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
import React from 'react'; | ||
|
||
interface ScanData { | ||
interface Scan { | ||
id: number; | ||
title: string; | ||
rawData: string; | ||
imageUrl: string; | ||
} | ||
|
||
interface ScanListProps { | ||
scans: ScanData[]; | ||
scans: Scan[]; | ||
} | ||
const ScanList: React.FC<ScanListProps> = ({ scans }) => ( | ||
<div className="scan-list"> | ||
{scans.map((scan, index) => ( | ||
<div key={index} className="scan-item"> | ||
<h3>{scan.title}</h3> | ||
<p>{scan.rawData.substring(0, 50)}...</p> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
|
||
const ScanList: React.FC<ScanListProps> = ({ scans }) => { | ||
return ( | ||
<div className="flex flex-row space-x-4"> | ||
{scans.map((scan) => ( | ||
<div key={scan.id} className="p-4 border border-gray-300 rounded-md"> | ||
<img | ||
src={scan.imageUrl} | ||
alt={scan.title} | ||
className="mb-2 rounded-md w-40 h-auto" | ||
/> | ||
<h3 className="font-bold">{scan.title}</h3> | ||
<p>{scan.rawData}</p> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ScanList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters