import { useNavigate, useParams } from '@/router'
import InjectMessageView from '@/views/InjectMessageView'

const Page = () => {
  const { teamId, exerciseId, channelId, actionLogId } = useParams(
    '/trainee/:exerciseId/:teamId/:channelId/form/:actionLogId'
  )
  const nav = useNavigate()

  return (
    <InjectMessageView
      teamId={teamId}
      exerciseId={exerciseId}
      actionLogId={actionLogId}
      onBack={() =>
        nav(`/trainee/:exerciseId/:teamId/:channelId/form`, {
          params: {
            teamId,
            exerciseId,
            channelId,
          },
        })
      }
    />
  )
}

export default Page
