forked from passportxyz/passport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRefreshMyStampsModalContentCardList.tsx
36 lines (31 loc) · 1.2 KB
/
RefreshMyStampsModalContentCardList.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// --- Types
import { getPlatformSpec } from "../config/platforms";
import { PROVIDER_ID } from "@gitcoin/passport-types";
// --- App components
import { RefreshMyStampsModalContentCard } from "./RefreshMyStampsModalContentCard";
import { ValidatedPlatform } from "../signer/utils";
export type RefreshMyStampsModalCardListProps = {
validPlatforms: ValidatedPlatform[];
selectedProviders: PROVIDER_ID[];
setSelectedProviders: (providerIds: PROVIDER_ID[]) => void;
};
export const RefreshMyStampsModalContentCardList = ({
validPlatforms,
selectedProviders,
setSelectedProviders,
}: RefreshMyStampsModalCardListProps) => {
const cardList = validPlatforms.map((validPlatform: ValidatedPlatform, index: number) => {
const currentPlatform = getPlatformSpec(validPlatform.platformProps.platform.path);
const platformGroups = validPlatform.groups;
return (
<RefreshMyStampsModalContentCard
key={currentPlatform ? currentPlatform.name : `undefined-${index}`}
platformGroups={platformGroups}
currentPlatform={currentPlatform}
selectedProviders={selectedProviders}
setSelectedProviders={setSelectedProviders}
/>
);
});
return <>{cardList}</>;
};