import { useBlocksQuery } from '../../../src/gql'
import { FunctionComponent } from 'react'
import { TBlock } from '../../../src/training/types'
import { AdminList } from '../../../src/app'

const AdminBlock: FunctionComponent<{ item: TBlock }> = ({ item }) => {
  return (
    <div>
      {item.id} {item.title}
    </div>
  )
}

const AdminBlocks = () => {
  const props = {
    name: 'Blocks',
    adminMenu: '/admin/block',
    get: useBlocksQuery(),
    dataKey: 'blocks',
    Component: AdminBlock,
  }
  return <AdminList {...props} />
}

export default AdminBlocks
