import IconFont from '@/components/icon-font'; import HotKeys from '@/config/hotkeys'; import { platformCall } from '@/utils'; import { ClearOutlined, EnterOutlined, PlusOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Button, Col, Row, Space } from 'antd'; import { useHotkeys } from 'react-hotkeys-hook'; import { Roles } from '../config'; import '../style/chat-footer.less'; interface ChatFooterProps { onSubmit: () => void; onStop: () => void; onClear: () => void; onNewMessage: () => void; onView: () => void; disabled?: boolean; feedback?: React.ReactNode; hasTokenResult?: boolean; selectedModel?: string; } const ChatFooter: React.FC = (props) => { console.log('chat footer====='); const platform = platformCall(); const intl = useIntl(); const { onSubmit, onClear, onStop, onNewMessage, onView, feedback, disabled, hasTokenResult, selectedModel } = props; useHotkeys( HotKeys.SUBMIT.join(','), () => { onSubmit(); }, { enabled: !disabled } ); const MessageRoles = [ { key: Roles.User, label: intl.formatMessage({ id: 'playground.user' }) }, { key: Roles.Assistant, label: intl.formatMessage({ id: 'playground.assistant' }) } ]; return (
{feedback} {!disabled ? ( ) : ( )}
); }; export default ChatFooter;