import EditorPage from '@/editor/EditorPage'
import InjectSpecification from '@/editor/InjectSpecification'
import { PageNames } from '@/editor/types'
import useEditorAccessStorage from '@/editor/useEditorAccessStorage'
import { useParams } from '@/router'
import { memo } from 'react'

const InjectSpecificationPage = () => {
  const { injectId } = useParams(
    '/editor/create/inject-specification/:injectId'
  )
  const [access] = useEditorAccessStorage()

  return (
    <EditorPage
      pageKey={PageNames.INJECT_SPECIFICATION}
      prevPath='/editor/create/inject-specification'
      nextVisible={false}
      pageVisible={access?.injectsFilled}
    >
      <InjectSpecification injectInfoId={Number(injectId)} />
    </EditorPage>
  )
}

export default memo(InjectSpecificationPage)
