Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
samderanova committed Jan 27, 2024
1 parent d034546 commit 0198f08
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import TextFilter, {
TextFilterProps,
} from "@cloudscape-design/components/text-filter";

import type { Options } from "./ParticipantsTable";
import {
Decision,
PostAcceptedStatus,
ReviewStatus,
Status,
} from "@/lib/admin/useApplicant";
import { StatusLabels } from "../../applicants/components/ApplicantStatus";
import type { Options } from "./ParticipantsTable";

interface ParticipantsFiltersProps {
filteredItemsCount: number | undefined;
Expand All @@ -43,11 +43,16 @@ const StatusIcons: Record<Status, IconProps.Name> = {
[PostAcceptedStatus.void]: "status-negative",
};

const statusOption = (status: MultiselectProps.Option) => ({
label: StatusLabels[status.value],
value: status.value,
iconName: StatusIcons[status.value],
});
const statusOption = (status: MultiselectProps.Option) => {
if (status.value === undefined) {
throw Error();
}
return {
label: StatusLabels[status.value as Status],
value: status.value,
iconName: StatusIcons[status.value as Status],
};
};

function ParticipantsFilters({
filteredItemsCount,
Expand Down

0 comments on commit 0198f08

Please sign in to comment.