import { ComponentType } from 'react' import { HugeDecimal } from '@dao-dao/math' import { RegistrationResponse } from '../contracts/DaoVoteDelegation' import { DelegateWithEntity, DelegationWithEntity } from '../delegation' import { LoadingDataWithError } from '../misc' import { TransProps } from './Trans' export type DelegationForm = { delegate: string percent: string } export type StatelessDaoVoteDelegationCardProps = { /** * Optional container class name. */ className?: string /** * Total voting power in the DAO. */ totalVotingPower: LoadingDataWithError /** * Wallet voting power. */ walletVotingPower: LoadingDataWithError /** * Delegates. */ delegates: LoadingDataWithError /** * Delegations. */ delegations: LoadingDataWithError /** * The current wallet's delegate registration info. */ registration: LoadingDataWithError /** * Whether or not the delegate registration/unregistration is loading. */ loadingRegistration: boolean /** * Function to register/unregister as a delegate. */ updateRegistration: (register: boolean) => Promise /** * Whether or not delegation is loading. */ loadingDelegate: boolean /** * Function to delegate. */ delegate: (data: DelegationForm) => Promise /** * Whether or not undelegation is loading. */ loadingUndelegate: boolean /** * Function to undelegate. */ undelegate: (delegate: string) => Promise /** * Stateful Trans component. */ Trans: ComponentType } export type StatefulDaoVoteDelegationCardProps = Omit< StatelessDaoVoteDelegationCardProps, | 'totalVotingPower' | 'walletVotingPower' | 'delegates' | 'delegations' | 'registration' | 'loadingRegistration' | 'updateRegistration' | 'loadingDelegate' | 'delegate' | 'loadingUndelegate' | 'undelegate' | 'Trans' >