Advertisement
IcaroPeretti

representant-form

Aug 18th, 2021
955
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { useState } from 'react'
  2. import Grid from '@material-ui/core/Grid'
  3. import { Input, Button, InputCpf } from '..'
  4. import useStyles from './styles'
  5.  
  6. type Props = {
  7.   state: any
  8.   setState: any
  9.   handleFilter: () => Promise<any>
  10. }
  11.  
  12. const FormRepresentant: React.FC<Props> = ({ state, setState, handleFilter }) => {
  13.   const classes = useStyles()
  14.  
  15.   // const handleTextMask = (e: any): void => {
  16.   //   setCpfCnpj(e.target.value.replace(/\D/g, ''))
  17.   // }
  18.  
  19.   return (
  20.     <>
  21.       <Grid item md={2} sm={6} xs={12}>
  22.         <Input
  23.           label="Código"
  24.           margin="dense"
  25.           className={classes.input}
  26.           value={state.code}
  27.           onChange={(e) =>
  28.             setState((old: any) => ({ ...old, code: e.target.value.replace(/\D/g, '') }))
  29.           }
  30.         />
  31.       </Grid>
  32.       <Grid item md={2} sm={6} xs={12}>
  33.         <Input
  34.           label="Nome"
  35.           margin="dense"
  36.           value={state.name}
  37.           className={classes.input}
  38.           onChange={(e) => setState((old: any) => ({ ...old, name: e.target.value }))}
  39.         />
  40.       </Grid>
  41.       <Grid item md={2} sm={6} xs={12}>
  42.         <InputCpf value={''} datatype="number" />
  43.       </Grid>
  44.       <Grid item md={2} sm={6} xs={12}>
  45.         <Button label="filtrar" style={{ marginTop: 8 }} variant="text" onClick={handleFilter} />
  46.       </Grid>
  47.     </>
  48.   )
  49. }
  50.  
  51. export default FormRepresentant
  52.  
Advertisement
RAW Paste Data Copied
Advertisement