Download web/app/components/base/markdown-blocks/button.tsx from ZHZ1024/dify: direct link, hf CLI and curl.
- Browser
- Download file 681 Bytes
-
https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/app/components/base/markdown-blocks/button.tsx
- Command line
-
hf download hf://spaces/ZHZ1024/dify/web/app/components/base/markdown-blocks/button.tsx
-
curl -L -o button.tsx https://huggingface.co/spaces/ZHZ1024/dify/resolve/main/web/app/components/base/markdown-blocks/button.tsx
681 Bytes
| import { useChatContext } from '@/app/components/base/chat/chat/context' | |
| import Button from '@/app/components/base/button' | |
| import cn from '@/utils/classnames' | |
| const MarkdownButton = ({ node }: any) => { | |
| const { onSend } = useChatContext() | |
| const variant = node.properties.dataVariant | |
| const message = node.properties.dataMessage | |
| const size = node.properties.dataSize | |
| return <Button | |
| variant={variant} | |
| size={size} | |
| className={cn('!h-8 !px-3 select-none')} | |
| onClick={() => onSend?.(message)} | |
| > | |
| <span className='text-[13px]'>{node.children[0]?.value || ''}</span> | |
| </Button> | |
| } | |
| MarkdownButton.displayName = 'MarkdownButton' | |
| export default MarkdownButton | |