dify
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
'use client'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
RiAddLine,
|
||||
RiFunctionAddLine,
|
||||
} from '@remixicon/react'
|
||||
import Option from './option'
|
||||
import { ApiConnectionMod } from '@/app/components/base/icons/src/vender/solid/development'
|
||||
|
||||
const CreateAppCard = () => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div className='flex 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'>
|
||||
<Option
|
||||
href={'/datasets/create'}
|
||||
Icon={RiAddLine}
|
||||
text={t('dataset.createDataset')}
|
||||
/>
|
||||
<Option
|
||||
href={'/datasets/create-from-pipeline'}
|
||||
Icon={RiFunctionAddLine}
|
||||
text={t('dataset.createFromPipeline')}
|
||||
/>
|
||||
</div>
|
||||
<div className='border-t-[0.5px] border-divider-subtle p-2'>
|
||||
<Option
|
||||
href={'/datasets/connect'}
|
||||
Icon={ApiConnectionMod}
|
||||
text={t('dataset.connectDataset')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
CreateAppCard.displayName = 'CreateAppCard'
|
||||
|
||||
export default CreateAppCard
|
||||
@@ -0,0 +1,27 @@
|
||||
import Link from 'next/link'
|
||||
import React from 'react'
|
||||
|
||||
type OptionProps = {
|
||||
Icon: React.ComponentType<{ className?: string }>
|
||||
text: string
|
||||
href: string
|
||||
}
|
||||
|
||||
const Option = ({
|
||||
Icon,
|
||||
text,
|
||||
href,
|
||||
}: OptionProps) => {
|
||||
return (
|
||||
<Link
|
||||
type='button'
|
||||
className='flex w-full items-center gap-x-2 rounded-lg bg-transparent px-4 py-2 text-text-tertiary shadow-shadow-shadow-3 hover:bg-background-default-dodge hover:text-text-secondary hover:shadow-xs'
|
||||
href={href}
|
||||
>
|
||||
<Icon className='h-4 w-4 shrink-0' />
|
||||
<span className='system-sm-medium grow text-left'>{text}</span>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export default React.memo(Option)
|
||||
Reference in New Issue
Block a user