refactor: replace anchor tag with Link component for navigation in Actions

This commit is contained in:
twwu 2025-05-29 17:42:00 +08:00
parent 9f724c19db
commit a61f1f8eb0

View File

@ -3,6 +3,7 @@ import Button from '@/app/components/base/button'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useParams } from 'next/navigation' import { useParams } from 'next/navigation'
import { RiArrowRightLine } from '@remixicon/react' import { RiArrowRightLine } from '@remixicon/react'
import Link from 'next/link'
type ActionsProps = { type ActionsProps = {
disabled?: boolean disabled?: boolean
@ -18,8 +19,9 @@ const Actions = ({
return ( return (
<div className='flex justify-end gap-x-2'> <div className='flex justify-end gap-x-2'>
<a <Link
href={`/datasets/${datasetId}/documents`} href={`/datasets/${datasetId}/documents`}
replace
> >
<Button <Button
variant='ghost' variant='ghost'
@ -27,7 +29,7 @@ const Actions = ({
> >
{t('common.operation.cancel')} {t('common.operation.cancel')}
</Button> </Button>
</a> </Link>
<Button <Button
disabled={disabled} disabled={disabled}
variant='primary' variant='primary'