Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.1 KB
Raw Blame
import { Settings2Icon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { useAgentStore } from '@/store/agent';
import { agentByIdSelectors } from '@/store/agent/selectors';

import { useAgentId } from '../../hooks/useAgentId';
import { ChatInputAction } from '../components/ChatInputAction';
import Controls from './Controls';

const Params = memo(() => {
  const agentId = useAgentId();
  const [isLoading] = useAgentStore((s) => [
    agentByIdSelectors.isAgentConfigLoadingById(agentId)(s),
  ]);
  const { t } = useTranslation('setting');

  if (isLoading) return <ChatInputAction disabled icon={Settings2Icon} />;

  return (
    <ChatInputAction
      icon={Settings2Icon}
      showTooltip={false}
      title={t('settingModel.params.title')}
      popover={{
        content: <Controls />,
        maxWidth: 384,
        minWidth: 384,
        styles: {
          content: {
            borderRadius: 16,
            overflow: 'hidden',
            padding: 0,
          },
        },
      }}
    />
  );
});

export default Params;