@@ -3,15 +3,25 @@ import { Note } from "@/types/OmopTables";
33import { Card , CardContent , CardHeader , CardTitle } from "@/components/ui/card" ;
44import { getMultiplePmcArticles } from "@/lib/services/pmcService" ;
55import { Badge } from "@/components/ui/badge" ;
6-
6+ import { ConceptHover } from "./ConceptHover" ;
77export default async function NotesList ( {
8+ relatedConcepts,
89 notes,
9- conceptIds,
10- conceptName,
10+ conceptDetails,
1111} : {
12+ relatedConcepts : Array < {
13+ inputConceptId : string ;
14+ groupConcepts : Array < {
15+ conceptId : string ;
16+ conceptName : string ;
17+ } > ;
18+ } > ;
1219 notes : Note [ ] ;
13- conceptIds : Array < string > | null ;
14- conceptName : string | null ;
20+ conceptDetails : Array < {
21+ conceptId : string ;
22+ conceptName : string ;
23+ domain : string ;
24+ } > ;
1525} ) {
1626 // Sort the PMC IDs for caching
1727 const pmcids = Array . from (
@@ -21,30 +31,40 @@ export default async function NotesList({
2131 . filter ( ( id ) : id is string => Boolean ( id ) ) ,
2232 ) ,
2333 ) . sort ( ) ;
24-
2534 if ( pmcids . length === 0 ) return ;
2635 const articles =
2736 pmcids . length > 0 ? await getMultiplePmcArticles ( pmcids ) : { } ;
2837
2938 return (
3039 < Card className = "col-span-2" >
3140 < CardHeader >
32- < CardTitle className = "text-2xl" >
33- { conceptIds && conceptName
34- ? `Case Reports for ${ conceptName } `
35- : "No term selected" }
41+ < CardTitle className = "flex flex-wrap gap-2 items-center" >
42+ < span className = "text-2xl" > Case Reports for: </ span >
43+ { conceptDetails . map ( ( c ) => {
44+ const related = relatedConcepts . find (
45+ ( r ) => r . inputConceptId === c . conceptId ,
46+ ) ;
47+ return (
48+ < ConceptHover
49+ key = { c . conceptId }
50+ conceptName = { c . conceptName }
51+ relatedConcepts = { related ?. groupConcepts }
52+ />
53+ ) ;
54+ } ) }
3655 </ CardTitle >
3756 </ CardHeader >
3857
3958 < CardContent >
40- { ! conceptIds ? (
59+ { ! conceptDetails ? (
4160 < div className = "text-muted-foreground text-center py-10" >
4261 Select a concept from the sidebar to view the associated Case
4362 Reports.
4463 </ div >
4564 ) : notes . length === 0 ? (
4665 < div className = "text-muted-foreground text-center py-10" >
47- No notes found for { conceptName }
66+ No notes found for
67+ { conceptDetails . map ( ( c ) => c . conceptName ) . join ( ", " ) } .
4868 </ div >
4969 ) : (
5070 < div className = "grid grid-cols-1 gap-4" >
0 commit comments