import './styles.css'
import { React, useState } from 'react'
import {
RuxIcon,
RuxInput,
RuxSelect,
RuxCheckbox,
RuxCheckboxGroup,
RuxRadio,
RuxRadioGroup,
RuxSlider,
RuxButton,
RuxOption,
} from '@astrouxds/react'
export default function App() {
const [firstName, setFirstName] = useState('')
const [lastName, setLastName] = useState('')
const [email, setEmail] = useState('')
const [countryRegion, setCountryRegion] = useState('United States')
const [options, setOptions] = useState('')
const [range, setRange] = useState(50)
const [things, setThings] = useState([])
const handleSubmit = (e) => {
e.preventDefault()
alert(`
First Name: ${firstName} \n
Last Name: ${lastName} \n
Email: ${email} \n
Country/Region: ${countryRegion} \n
Options: ${options} \n
Things: ${things} \n
Range: ${range} \n
`)
}
const handleThings = (e) => {
let arr = things
if (e.target.checked) {
arr.push(e.target.value)
let unique = [...new Set(arr)]
setThings(unique)
} else {
setThings(arr.filter((item) => item !== e.target.value))
}
}
return (
<div className="container">
<form onSubmit={(e) => handleSubmit(e)}>
<div>
<RuxButton type="submit" size="large">
<RuxIcon icon="tune" size="28px" style={{width:"28px", height:"28px"}}/>
</RuxButton>
</div>
</form>
</div>
)
}
return (
<div className="container">
<form onSubmit={(e) => handleSubmit(e)}>
<div>
<RuxButton type="submit" size="large">
<RuxIcon icon="tune" size="28px" className="myIcon"/>
</RuxButton>
</div>
</form>
</div>
)
}
.container {
/* text-align: center; */
width: 60%;
margin: auto;
}
form {
padding: 1rem;
}
div {
margin-bottom: 20px;
}
.myIcon {
width: "28px";
height: "28px";
}