import {ModalField} from '@components';
import {FC} from 'react';
import {useField, useFormValues} from './hooks';

type Props = {
  id: string;
};

const Info: FC<Props> = function ({id}) {
  const [{control}] = useField();
  useFormValues(id);

  return (
    <>
      <ModalField
        name='menuID'
        label='菜单ID'
        control={control}
        disabled={Boolean(id)}
      />
      <ModalField name='menuName' label='菜单名称' control={control} />
      <ModalField
        name='menuOrderBy'
        label='菜单排序'
        control={control}
        type='number'
      />
    </>
  );
};

export default Info;
