diff --git a/src/components/Entity/OnCallListCard.tsx b/src/components/Entity/OnCallListCard.tsx index f03288d..dbacf36 100644 --- a/src/components/Entity/OnCallListCard.tsx +++ b/src/components/Entity/OnCallListCard.tsx @@ -12,13 +12,14 @@ import { OnCallForScheduleList } from '../OnCallList/OnCallList'; type OnCallListCardProps = { title?: string; variant?: InfoCardVariants; -}; +} & Omit; type OnCallListContentProps = { teamName: string; + scheduleId?: string; } -const OnCallListCardContent = ({ teamName }: OnCallListContentProps) => { +const OnCallListCardContent = ({ teamName, scheduleId }: OnCallListContentProps) => { const opsgenieApi = useApi(opsgenieApiRef); const { value, loading, error } = useAsync(async () => await opsgenieApi.getSchedulesForTeam(teamName)); @@ -34,7 +35,9 @@ const OnCallListCardContent = ({ teamName }: OnCallListContentProps) => { return (
- {value!.filter(schedule => schedule.enabled).map(schedule => )} + {value! + .filter(schedule => schedule.enabled && (!scheduleId || schedule.id === scheduleId)) + .map(schedule => )}
); }