import {ModalField, ModalSelect} from '@components';
import {FC} from 'react';
import {useFormInfoValue, useFormInstance} from './hooks';

const stateOptions = [
  {value: '1', label: '启用'},
  {value: '0', label: '禁用'},
];

type Props = {
  id: string;
};

const StoreModalInfo: FC<Props> = function({id}) {
  const control = useFormInstance();
  useFormInfoValue(id);

  return (
    <>
      <ModalField
        name='storageLocationCode'
        width='300px'
        label='库位编号'
        control={control}
      />
      <ModalField
        name='storageLocationName'
        width='300px'
        label='库位名称'
        control={control}
      />
      <ModalField
        name='storageLocationType'
        width='300px'
        label='库位类型'
        control={control}
      />
      <ModalField
        name='storageWarehouseWhere'
        width='300px'
        label='所在仓库'
        control={control}
      />
      <ModalField
        name='storageCapacity'
        width='300px'
        label='库位容量'
        type='number'
        control={control}
      />
      <ModalSelect
        name='storageIsNotDisable'
        width='300px'
        label='状态'
        control={control}
        data={stateOptions}
      />
    </>
  );
};

export default StoreModalInfo;
