zhongrj
2025-11-24 276323dce9613867abb3f58a4cc2abbfb2fd0dea
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
54
55
import React, { PureComponent, Fragment } from "react";
 
import { DropdownButton, MenuItem } from "react-bootstrap";
 
import "./PlatformSelectButton.scss";
 
export default class PlatformSelectButton extends PureComponent {
    static defaultProps = {
        platforms: [],
        onSelect: () => {}
    };
 
    handleClick = platform => () => this.props.onSelect(platform);
 
    render() {
        const {
            platforms,
            onSelect,
        } = this.props;
        
        const menuItems = platforms
            .map(platform => (
                <MenuItem
                    key={platform.name}
                    tag={"a"}
                    onClick={this.handleClick(platform)}
                >
                    <Fragment>
                        {"  "}
                        {platform.name}
                    </Fragment>
                </MenuItem>
            ));
 
        const title = (
            <Fragment>
                <i className={"fa fa-cloud-download-alt fa-cloud-import"} />
                Cloud Import
            </Fragment>
        
        );
 
        return (
            <DropdownButton
                id={"platformsDropdown"}
                bsStyle={"default"}
                bsSize={"small"}
                className={"platform-btn"}
                title={title}
            >
                {menuItems}
            </DropdownButton>
        );
    }
}