generated from susom/redcap-em-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workign through some of the desired workflow. need to continue work o…
…n UX and also prompt engineering to get actual 'scoring' as well as REDCap integration still
- Loading branch information
Showing
7 changed files
with
248 additions
and
60 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
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import { useStudents } from '../contexts/Students'; // Adjust the import path as necessary | ||
|
||
const scoreColors = { | ||
3: 'green', | ||
2: '#FFD700', | ||
1: 'red' | ||
}; | ||
|
||
const StatusIndicator = () => { | ||
const { selectedStudent } = useStudents(); | ||
|
||
if (!selectedStudent || !selectedStudent.reflections) { | ||
return <div>No data available</div>; | ||
} | ||
|
||
const { reflections } = selectedStudent; | ||
|
||
return ( | ||
<div className="status-indicator"> | ||
{Object.entries(reflections).map(([key, { score }]) => ( | ||
<div key={key} style={{ textAlign: 'center' }}> | ||
<div | ||
className="status-bar" | ||
style={{ backgroundColor: scoreColors[score] }} | ||
/> | ||
<div className="status-label"> | ||
{key.charAt(0).toUpperCase() + key.slice(1)} | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default StatusIndicator; |
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
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
Oops, something went wrong.