import { Row, Col, ListGroup, Alert, Card, Button } from 'react-bootstrap'; import { Project } from '../../../core/project'; export default function Permissions({ project = { deployedProject: {}, } as any, selectComponent, selectTab, }: { project: Project; selectComponent: (component: string, props?: any) => void; selectTab: (tab: string, props?: any) => void; }) { let deployments = Object.values(project.deployedProject.deployments); //filter duplicate contracts let approvals = {}; let contracts = deployments.filter( (contract, index, self) => index === self.findIndex((t) => t.contractName === contract.contractName) ); contracts.forEach((contract) => { approvals[contract.contractName] = contract.approved; }); return ( <> Admins These addresses have been granted admin access to your project and can view and use admin features. Add New Admin {Object.values( project.deployedProject.deployments.erc721.approved ).map((address) => { return ( {address} Revoke Admin Access ); })} Project Permissions Heres all of the approved addresses for each contract in your project. {Object.keys(approvals).map((contractName) => { if (!approvals[contractName]) return <>>; let approval = approvals[contractName]; return ( {contractName}{' '} {Object.keys(approval).length} {Object.keys(approval).map( (permission) => { return ( { approval[ permission ] }{' '} Approved ); } )} Modify Permissions { selectComponent('Contracts', { defaultContract: project.deployedProject .deployments[ contractName ], }); }} > Inspect Contract ); })} > ); }
These addresses have been granted admin access to your project and can view and use admin features.
Heres all of the approved addresses for each contract in your project.