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.

990 B
Raw Blame
'use client';

import { memo, Suspense } from 'react';
import { useParams } from 'react-router';

import AgentShareSettingsPage from '@/business/client/AgentShareSettingsPage';
import AgentShareSkeleton from '@/components/Skeleton/AgentShare';
import ResourceConfigAccessGate from '@/features/ResourcePermission/ResourceConfigAccessGate';

const AgentSharePage = memo(() => {
  const { aid } = useParams<{ aid: string }>();

  const skeleton = <AgentShareSkeleton />;

  return (
    <Suspense fallback={skeleton}>
      {/* Sharing exposes real execution in the Agent's owning billing scope —
          only resource managers may configure the external link. */}
      <ResourceConfigAccessGate
        loading={skeleton}
        redirectPath={`/agent/${aid ?? ''}`}
        requiredAccess="manage"
        resourceId={aid}
        resourceType="agent"
      >
        <AgentShareSettingsPage />
      </ResourceConfigAccessGate>
    </Suspense>
  );
});

export default AgentSharePage;