mirror of
https://github.com/langgenius/dify.git
synced 2026-04-21 23:38:53 +08:00
33 lines
738 B
TypeScript
33 lines
738 B
TypeScript
import type { RemixiconComponentType } from '@remixicon/react'
|
|
import * as React from 'react'
|
|
|
|
type OperationItemProps = {
|
|
Icon: RemixiconComponentType
|
|
name: string
|
|
handleClick?: () => void
|
|
}
|
|
|
|
const OperationItem = ({
|
|
Icon,
|
|
name,
|
|
handleClick,
|
|
}: OperationItemProps) => {
|
|
return (
|
|
<div
|
|
className="flex cursor-pointer items-center gap-x-1 rounded-lg px-2 py-1.5 hover:bg-state-base-hover"
|
|
onClick={(e) => {
|
|
e.preventDefault()
|
|
e.stopPropagation()
|
|
handleClick?.()
|
|
}}
|
|
>
|
|
<Icon className="size-4 text-text-tertiary" />
|
|
<span className="system-md-regular px-1 text-text-secondary">
|
|
{name}
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default React.memo(OperationItem)
|