
import React from 'react'
import { Col, Row } from 'reactstrap';
import { FakeSelectData } from '../../Layout/app/Const';
import { useFormikContext } from 'formik';

import { DatePicker } from 'antd';
import ValidationField from '../../Components/ValidationField/ValidationField';
import { useGetCategory } from '../../api/category';

function FormCategory() {
  const formik = useFormikContext<any>();

  const {data} = useGetCategory(); 

  const CategoryOption = data?.data?.map((e:any) =>({    
    value:e.id,
    label:e?.name
  }))

  return (
    <Row xs={1} sm={1} md={1} lg={2} xl={2}>
    <Col>
    {/* name from form utils */}
      <ValidationField name="name" type="text"label='name'  placeholder='placeholder' />
      <ValidationField name="parent_id" type="Select"label='parent_id' option={CategoryOption}  placeholder='placeholder' />
      
    </Col>
    <Col>
    <ValidationField name="image" type="File"label='image'  placeholder='placeholder' />

    </Col>

   
  </Row>
  )
}

export default FormCategory


