feat: knowledge base node

This commit is contained in:
zxhlyh
2025-05-07 15:08:13 +08:00
parent e86a3fc672
commit 3f52f491d7
15 changed files with 417 additions and 187 deletions

View File

@ -1,4 +1,5 @@
import type { ReactNode } from 'react'
import { memo } from 'react'
import cn from '@/utils/classnames'
export type BoxProps = {
@ -6,7 +7,7 @@ export type BoxProps = {
children?: ReactNode
withBorderBottom?: boolean
}
export const Box = ({
export const Box = memo(({
className,
children,
withBorderBottom,
@ -21,4 +22,4 @@ export const Box = ({
{children}
</div>
)
}
})

View File

@ -1,4 +1,5 @@
import type { ReactNode } from 'react'
import { memo } from 'react'
import Tooltip from '@/app/components/base/tooltip'
import cn from '@/utils/classnames'
@ -8,7 +9,7 @@ export type FieldTitleProps = {
subTitle?: string | ReactNode
tooltip?: string
}
export const FieldTitle = ({
export const FieldTitle = memo(({
title,
operation,
subTitle,
@ -35,4 +36,4 @@ export const FieldTitle = ({
}
</div>
)
}
})

View File

@ -1,4 +1,5 @@
import type { ReactNode } from 'react'
import { memo } from 'react'
import type { FieldTitleProps } from '.'
import { FieldTitle } from '.'
@ -6,7 +7,7 @@ export type FieldProps = {
fieldTitleProps: FieldTitleProps
children: ReactNode
}
export const Field = ({
export const Field = memo(({
fieldTitleProps,
children,
}: FieldProps) => {
@ -16,4 +17,4 @@ export const Field = ({
{children}
</div>
)
}
})

View File

@ -1,4 +1,5 @@
import type { ReactNode } from 'react'
import { memo } from 'react'
import {
Box,
Group,
@ -13,7 +14,7 @@ type GroupWithBoxProps = {
boxProps?: Omit<BoxProps, 'children'>
groupProps?: Omit<GroupProps, 'children'>
}
export const GroupWithBox = ({
export const GroupWithBox = memo(({
children,
boxProps,
groupProps,
@ -25,4 +26,4 @@ export const GroupWithBox = ({
</Group>
</Box>
)
}
})

View File

@ -1,4 +1,5 @@
import type { ReactNode } from 'react'
import { memo } from 'react'
import cn from '@/utils/classnames'
export type GroupProps = {
@ -6,7 +7,7 @@ export type GroupProps = {
children?: ReactNode
withBorderBottom?: boolean
}
export const Group = ({
export const Group = memo(({
className,
children,
withBorderBottom,
@ -21,4 +22,4 @@ export const Group = ({
{children}
</div>
)
}
})