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.

981 B
Raw Blame
'use client';

import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
import urlJoin from 'url-join';

import { ModelIcon } from '@/components/LobeIcons';
import { OFFICIAL_URL } from '@/const/url';

import ShareButton from '../../../../features/ShareButton';
import { useDetailContext } from '../../DetailProvider';
import ChatWithModel from './ChatWithModel';

const ActionButton = memo(() => {
  const { description, providers, displayName, identifier } = useDetailContext();
  return (
    <Flexbox horizontal align={'center'} gap={8}>
      <ChatWithModel />
      <ShareButton
        meta={{
          avatar: <ModelIcon model={identifier} size={64} type={'avatar'} />,
          desc: description,
          hashtags: providers?.map((item) => item.name) || [],
          title: displayName || identifier,
          url: urlJoin(OFFICIAL_URL, '/community/model', identifier as string),
        }}
      />
    </Flexbox>
  );
});

export default ActionButton;