import React from "react";
import classNames from "classnames";
import { makeStyles } from "@material-ui/core/styles";
import Select from 'react-select';

import Button from "components/CustomButtons/Button.js";
import Icon from "@material-ui/core/Icon";
import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
import Card from "components/Card/Card.js";
import CardBody from "components/Card/CardBody.js";
import GridContainer from "components/Grid/GridContainer.js";
import SnackbarContent from "components/Snackbar/SnackbarContent.js";

const useStyles = makeStyles(styles);

const DataApparel = function ({ selected, handleName, backend, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, ...props }) {
    const classes = useStyles();
    const { ...rest } = props;
    const imageClasses = classNames(
        classes.imgRaised,
        classes.imgRoundedCircle,
        classes.imgFluid
    );
    const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
    const ProductApparelRCon = apparel.map((data) => {
        return (   
        <div style={{padding: "20px", marginTop:"-40px"}}>   
        <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
            <CardBody>
            <div style={{padding:"10px"}}>
                <img
                    alt="..."
                    style={{ height: "150px", display: "block" }}
                    src={`${backend}${data.img["url"]}`}
                    className={navImageClasses}
                />
                <div align="center">
                <h5>{data.name}</h5>
                <h5>Rp.{data.price}</h5>
                <Button 
                    color="info" round
                    href={"/yamaha/product/apparel_details?s="+data.id}
                >
                    <Icon className={classes.icons}>open_in_new</Icon>Detail Product
                </Button>
                </div>
            </div>
            </CardBody>
        </Card>
        </div>
        );
    })
    const ProductApparelAsia = asia.map((data) => {
        return (   
        <div style={{padding: "20px", marginTop:"-40px"}}>   
        <Card className={classes.textCenter} align="center" style={{width:"350px"}}>
            <CardBody>
            <div style={{padding:"10px"}}>
                <img
                    alt="..."
                    style={{ height: "150px", display: "block" }}
                    src={`${backend}${data.img["url"]}`}
                    className={navImageClasses}
                />
                <div align="center">
                <h5>{data.name}</h5>
                <h5>Rp.{data.price}</h5>
                <Button 
                    color="info" round
                    href={"/yamaha/product/apparel_details?s="+data.id}
                >
                    <Icon className={classes.icons}>open_in_new</Icon>Detail Product
                </Button>
                </div>
            </div>
            </CardBody>
        </Card>
        </div>
        );
    })
    return (
        <div>
        <Card className={classes.textCenter} align="center">
            <CardBody>
            {/* <div align="center">
                <h2>Yamaha Apparel</h2>
                <Select
                    value={(selected)?apparel.filter((i)=>i.id==selected):null} 
                    getOptionLabel={option => `${option.name}`}
                    getOptionValue={option => option.id}
                    options={apparel}
                    isMulti
                    instanceId="name"
                    placeholder="filter by Nama Part"
                    onChange={values => handleName(values)}
                />
            </div><br></br><br></br><br></br> */}
            <div align="center">
                <div align="center" className={classes.section} id="notifications">
                    <SnackbarContent
                    message={
                        <h4>APPAREL R CONCEPT</h4>
                    }
                    align="center"
                    color="danger"
                    />
                </div>
                <GridContainer justify="center">
                    {ProductApparelRCon}
                </GridContainer>
            </div><br></br><br></br>
            <div align="center">
                <div align="center" className={classes.section} id="notifications">
                    <SnackbarContent
                    message={
                        <h4>APPAREL 46ASIA</h4>
                    }
                    align="center"
                    color="danger"
                    />
                </div>
                <GridContainer justify="center">
                    {ProductApparelAsia}
                </GridContainer>
            </div><br></br><br></br>
            </CardBody>
        </Card>
        </div>
    );
}

export default DataApparel;