fix: Correct link path for creating datasets and optimize Link component with memoization

This commit is contained in:
twwu
2025-04-29 15:47:29 +08:00
parent 9392ce259f
commit 2613a380b6
2 changed files with 4 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ const CreateAppCard = ({
return (
<div className='flex min-h-[166px] flex-col gap-y-0.5 rounded-xl bg-background-default-dimmed'>
<div className='flex grow flex-col items-center justify-center p-2'>
<Link href={`${basePath}/datasets/create-pipeline`} Icon={RiFunctionAddLine} text={t('dataset.createFromPipeline')} />
<Link href={`${basePath}/datasets/create-from-pipeline`} Icon={RiFunctionAddLine} text={t('dataset.createFromPipeline')} />
<Link ref={ref} href={`${basePath}/datasets/create`} Icon={RiAddLine} text={t('dataset.createDataset')} />
</div>
<div className='border-t-[0.5px] border-divider-subtle p-2'>

View File

@@ -1,3 +1,5 @@
import React from 'react'
type LinkProps = {
Icon: React.ComponentType<{ className?: string }>
text: string
@@ -23,4 +25,4 @@ const Link = ({
)
}
export default Link
export default React.memo(Link)