Skip to content

Commit 759e630

Browse files
authored
Merge pull request #22 from Health-Informatics-UoN/ui/updates
UI/updates
2 parents e46c808 + f82f379 commit 759e630

4 files changed

Lines changed: 84 additions & 60 deletions

File tree

components/NotesList.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default async function NotesList({
88
relatedConcepts,
99
notes,
1010
conceptDetails,
11+
total,
1112
}: {
1213
relatedConcepts: Array<{
1314
inputConceptId: string;
@@ -22,6 +23,7 @@ export default async function NotesList({
2223
conceptName: string;
2324
domain: string;
2425
}>;
26+
total: number;
2527
}) {
2628
// Sort the PMC IDs for caching
2729
const pmcids = Array.from(
@@ -36,10 +38,11 @@ export default async function NotesList({
3638
pmcids.length > 0 ? await getMultiplePmcArticles(pmcids) : {};
3739

3840
return (
39-
<Card className="col-span-2">
41+
<Card className="col-span-2 ring-0" >
4042
<CardHeader>
4143
<CardTitle className="flex flex-wrap gap-2 items-center">
4244
<span className="text-2xl">Case Reports for: </span>
45+
4346
{conceptDetails.map((c) => {
4447
const related = relatedConcepts.find(
4548
(r) => r.inputConceptId === c.conceptId,
@@ -52,7 +55,10 @@ export default async function NotesList({
5255
/>
5356
);
5457
})}
58+
59+
5560
</CardTitle>
61+
<div className="text-sm text-muted-foreground">{total} results</div>
5662
</CardHeader>
5763

5864
<CardContent>
@@ -68,7 +74,8 @@ export default async function NotesList({
6874
</div>
6975
) : (
7076
<div className="grid grid-cols-1 gap-4">
71-
<div className="mb-4 flex items-center gap-2">
77+
78+
<div className=" flex items-center gap-2">
7279
<Badge variant="outline" className="bg-sky-100 dark:bg-[#1B3C53]">
7380
Condition
7481
</Badge>
@@ -91,7 +98,7 @@ export default async function NotesList({
9198
Measurement
9299
</Badge>
93100
</div>
94-
<div className="grid grid-cols-1 gap-4 px-1 py-1">
101+
<div className="grid grid-cols-1 gap-4 py-1">
95102
{notes.map((note) => {
96103
const pmcid = note.note_source_value?.match(/PMC(\d+)/)?.[1];
97104

components/NotesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export default async function NotesSection({
2626
const totalPages = Math.ceil(total / pageSize);
2727
return (
2828
<div className="p-4 space-y-4">
29-
<div className="text-sm text-muted-foreground">{total} articles</div>
3029
<NotesList
3130
relatedConcepts={relatedConcepts}
3231
notes={notes}
3332
conceptDetails={conceptDetails}
33+
total={total}
3434
/>
3535
<NotesPagination page={page} totalPages={totalPages} />
3636
</div>

lib/services/pmcService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ async function getPmcArticle(pmcid: string): Promise<any> {
1414
const parser = new XMLParser({
1515
ignoreAttributes: false,
1616
attributeNamePrefix: "",
17+
htmlEntities: true,
1718
});
1819

1920
const json = parser.parse(xml);

package-lock.json

Lines changed: 72 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)