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.

1012 B
Raw Blame
'use client';

import type { BuiltinInspectorProps } from '@lobechat/types';
import { cx } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { inspectorTextStyles, shinyTextStyles } from '@/styles';

import type { CreateGoalParams, CreateGoalState } from '../../../types';

const CreateGoalInspector = memo<BuiltinInspectorProps<CreateGoalParams, CreateGoalState>>(
  ({ args, partialArgs, isArgumentsStreaming, isLoading, pluginState }) => {
    const { t } = useTranslation('plugin');
    const name = args?.name || partialArgs?.name || pluginState?.name;

    return (
      <div className={inspectorTextStyles.root}>
        <span className={cx((isArgumentsStreaming || isLoading) && shinyTextStyles.shinyText)}>
          {t('builtins.builtin-goal.apiName.createGoal')}
        </span>
        {name && <span> · {name}</span>}
      </div>
    );
  },
);

CreateGoalInspector.displayName = 'CreateGoalInspector';

export default CreateGoalInspector;