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

pull/21398/head
twwu 12 months ago
parent 9392ce259f
commit 2613a380b6

@ -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'>

@ -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)

Loading…
Cancel
Save