Skip to content

Commit

Permalink
Issue #PS-1389 feat: UI for displaying center wise attendance report …
Browse files Browse the repository at this point in the history
…as per Figma within a Block with API integration
  • Loading branch information
Aar-if committed Jul 19, 2024
1 parent 561dc01 commit 9cfbc48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/components/AttendanceComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface AttendanceResponse {

const AttendanceComparison: React.FC = () => {
const { t } = useTranslation();
const [centerType, setCenterType] = useState('Regular');
const [centerType, setCenterType] = useState('REGULAR');
const [attendanceData, setAttendanceData] = useState<Record<string, string>>(
{}
);
Expand Down Expand Up @@ -153,11 +153,11 @@ const AttendanceComparison: React.FC = () => {
onChange={handleCenterTypeChange}
>
<FormControlLabel
value="Regular"
value="REGULAR"
control={<Radio />}
label="Regular"
/>
<FormControlLabel value="Remote" control={<Radio />} label="Remote" />
<FormControlLabel value="REMOTE" control={<Radio />} label="Remote" />
</RadioGroup>
</FormControl>
<Box sx={{ mt: 2 }}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CohortSelectionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
items.forEach((item) => {
const cohortType =
item?.customField?.find(
(field) => field.label === 'Type of Cohort'
(field) => field.label === 'TYPE_OF_COHORT'
)?.value || 'Unknown';
if (item?.cohortId && item && item?.name) {
nameTypePairs.push({
Expand Down
10 changes: 5 additions & 5 deletions src/pages/centers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const TeachingCenters = () => {
const cohortName = child.name;
const cohortId = child.cohortId;
const centerTypeField = child?.customField.find(
(field: any) => field.label === 'Type of Cohort'
(field: any) => field.label === 'TYPE_OF_COHORT'
);

const centerType = centerTypeField ? centerTypeField.value : '';
Expand Down Expand Up @@ -374,7 +374,7 @@ const TeachingCenters = () => {
{/* Regular Centers */}
{filteredCenters.some(
(center) =>
center.centerType === 'Regular' ||
center.centerType === 'REGULAR' ||
center.centerType === ''
) && (
<div>
Expand All @@ -390,7 +390,7 @@ const TeachingCenters = () => {
{filteredCenters
.filter(
(center) =>
center.centerType === 'Regular' ||
center.centerType === 'REGULAR' ||
center.centerType === ''
)
.map((center) => (
Expand Down Expand Up @@ -461,7 +461,7 @@ const TeachingCenters = () => {

{/* Remote Centers */}
{filteredCenters.some(
(center) => center.centerType === 'Remote'
(center) => center.centerType === 'REMOTE'
) && (
<div>
<Box
Expand All @@ -474,7 +474,7 @@ const TeachingCenters = () => {
{t('CENTERS.REMOTE_CENTERS')}
</Box>
{filteredCenters
.filter((center) => center.centerType === 'Remote')
.filter((center) => center.centerType === 'REMOTE')
.map((center) => (
<React.Fragment key={center.cohortId}>
<Box
Expand Down

0 comments on commit 9cfbc48

Please sign in to comment.