import { useExercisesQuery } from '../../../src/gql'
import { FunctionComponent } from 'react'
import { TExercise } from '../../../src/training/types'
import { AdminList } from '../../../src/app'

const AdminExercise: FunctionComponent<{ item: TExercise }> = ({ item }) => {
  return (
    <div>
      {item.id} {item.name}
    </div>
  )
}

const AdminExercises = () => {
  const props = {
    name: 'Exercises',
    adminMenu: '/admin/exercise',
    get: useExercisesQuery(),
    dataKey: 'exercises',
    Component: AdminExercise,
  }
  return <AdminList {...props} />
}

export default AdminExercises
