-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReceiveTokenSwitcher.tsx
More file actions
53 lines (49 loc) · 1.08 KB
/
ReceiveTokenSwitcher.tsx
File metadata and controls
53 lines (49 loc) · 1.08 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { TokenSelectButton } from '@/src/pagePartials/bridge/bridgeForm/TokenSelectButton'
import styled from 'styled-components'
const Wrapper = styled.div`
align-items: center;
display: flex;
flex-direction: row;
gap: calc(var(--theme-common-space) * 2);
height: 100%;
justify-content: flex-start;
width: 100%;
`
interface IOption {
disabled?: boolean
icon?: string
label: string
name?: string
}
interface Props {
hasFullWidth?: boolean
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
options: IOption[]
optionsId: string
value: string
}
export const ReceiveTokenSwitcher = ({
onChange,
options,
optionsId,
value,
...restProps
}: Props) => {
return (
<Wrapper {...restProps}>
{options.map(({ disabled, icon, label, name }, index) => (
<TokenSelectButton
checked={value === label}
disabled={disabled}
icon={icon}
id={optionsId}
key={index}
label={label}
name={name}
onChange={onChange}
value={label}
/>
))}
</Wrapper>
)
}