mirror of
https://github.com/langgenius/dify.git
synced 2026-04-14 07:56:31 +08:00
Signed-off-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
32 lines
860 B
TypeScript
32 lines
860 B
TypeScript
import type { ReactNode } from 'react'
|
|
import { cn } from '@/utils/classnames'
|
|
|
|
const menuLabelClassName = 'min-w-0 grow truncate px-1 text-text-secondary system-md-regular'
|
|
const menuLeadingIconClassName = 'size-4 shrink-0 text-text-tertiary'
|
|
|
|
export const menuTrailingIconClassName = 'size-[14px] shrink-0 text-text-tertiary'
|
|
|
|
type MenuItemContentProps = {
|
|
iconClassName: string
|
|
label: ReactNode
|
|
trailing?: ReactNode
|
|
}
|
|
|
|
export function MenuItemContent({
|
|
iconClassName,
|
|
label,
|
|
trailing,
|
|
}: MenuItemContentProps) {
|
|
return (
|
|
<>
|
|
<span aria-hidden className={cn(menuLeadingIconClassName, iconClassName)} />
|
|
<div className={menuLabelClassName}>{label}</div>
|
|
{trailing}
|
|
</>
|
|
)
|
|
}
|
|
|
|
export function ExternalLinkIndicator() {
|
|
return <span aria-hidden className={cn('i-ri-arrow-right-up-line', menuTrailingIconClassName)} />
|
|
}
|