(feat:agent-details) test, learn more redirects

This commit is contained in:
ManishMadan2882
2025-06-17 16:04:08 +05:30
parent 7b45a6b956
commit 7f1cc30ed8
3 changed files with 72 additions and 21 deletions

View File

@@ -96,19 +96,32 @@ export default function AgentDetailsModal({
</h2>
</div>
{sharedToken ? (
<div className="items-center gap-2">
<div className="flex flex-col gap-2">
<p className="inline break-all font-roboto text-[14px] font-medium leading-normal text-gray-700 dark:text-[#ECECF1]">
{`${baseURL}/shared/agent/${sharedToken}`}
<CopyButton
textToCopy={`${baseURL}/shared/agent/${sharedToken}`}
padding="p-1"
className="ml-1 inline-flex"
className="absolute -mt-0.5 ml-1 inline-flex"
/>
</p>
<a
href="https://docs.docsgpt.cloud/Agents/basics#core-components-of-an-agent"
className="flex w-fit items-center gap-1 text-purple-30 hover:underline"
target="_blank"
rel="noopener noreferrer"
>
<span className="text-sm">Learn more</span>
<img
src="/src/assets/external-link.svg"
alt="External link"
className="h-3 w-3"
/>
</a>
</div>
) : (
<button
className="flex w-28 items-center justify-center rounded-3xl border border-solid border-violets-are-blue px-5 py-2 text-sm font-medium text-violets-are-blue transition-colors hover:bg-violets-are-blue hover:text-white"
className="flex w-28 items-center justify-center rounded-3xl border border-solid border-purple-30 px-5 py-2 text-sm font-medium text-purple-30 transition-colors hover:bg-purple-30 hover:text-white"
onClick={handleGeneratePublicLink}
>
{loadingStates.publicLink ? (
@@ -124,23 +137,37 @@ export default function AgentDetailsModal({
API Key
</h2>
{apiKey ? (
<div className="flex items-center gap-2">
<span className="break-all font-roboto text-[14px] font-medium leading-normal text-gray-700 dark:text-[#ECECF1]">
{apiKey}
<div className="flex flex-col gap-2">
<div className="flex items-center gap-2">
<div className="break-all font-roboto text-[14px] font-medium leading-normal text-gray-700 dark:text-[#ECECF1]">
{apiKey}
{!apiKey.includes('...') && (
<CopyButton
textToCopy={apiKey}
padding="p-1"
className="absolute -mt-0.5 ml-1 inline-flex"
/>
)}
</div>
{!apiKey.includes('...') && (
<CopyButton
textToCopy={apiKey}
padding="p-1"
className="ml-1 inline-flex"
/>
<a
href={`https://widget.docsgpt.cloud/?api-key=${apiKey}`}
className="group ml-8 flex w-[101px] items-center justify-center gap-1 rounded-[62px] border border-purple-30 py-1.5 text-sm font-medium text-purple-30 transition-colors hover:bg-purple-30 hover:text-white"
target="_blank"
rel="noopener noreferrer"
>
Test
<img
src="/src/assets/external-link.svg"
alt="External link"
className="h-3 w-3 group-hover:brightness-0 group-hover:invert"
/>
</a>
)}
</span>
{!apiKey.includes('...') && (
<CopyButton textToCopy={apiKey} padding="p-1" />
)}
</div>
</div>
) : (
<button className="w-28 rounded-3xl border border-solid border-violets-are-blue px-5 py-2 text-sm font-medium text-violets-are-blue transition-colors hover:bg-violets-are-blue hover:text-white">
<button className="w-28 rounded-3xl border border-solid border-purple-30 px-5 py-2 text-sm font-medium text-purple-30 transition-colors hover:bg-purple-30 hover:text-white">
Generate
</button>
)}
@@ -152,19 +179,32 @@ export default function AgentDetailsModal({
</h2>
</div>
{webhookUrl ? (
<div className="flex items-center gap-2">
<div className="flex flex-col gap-2">
<p className="break-all font-roboto text-[14px] font-medium leading-normal text-gray-700 dark:text-[#ECECF1]">
{webhookUrl}
<CopyButton
textToCopy={webhookUrl}
padding="p-1"
className="ml-1 inline-flex"
className="absolute -mt-0.5 ml-1 inline-flex"
/>
</p>
<a
href="https://docs.docsgpt.cloud/Agents/basics#core-components-of-an-agent"
className="flex w-fit items-center gap-1 text-purple-30 hover:underline"
target="_blank"
rel="noopener noreferrer"
>
<span className="text-sm">Learn more</span>
<img
src="/src/assets/external-link.svg"
alt="External link"
className="h-3 w-3"
/>
</a>
</div>
) : (
<button
className="flex w-28 items-center justify-center rounded-3xl border border-solid border-violets-are-blue px-5 py-2 text-sm font-medium text-violets-are-blue transition-colors hover:bg-violets-are-blue hover:text-white"
className="flex w-28 items-center justify-center rounded-3xl border border-solid border-purple-30 px-5 py-2 text-sm font-medium text-purple-30 transition-colors hover:bg-purple-30 hover:text-white"
onClick={handleGenerateWebhook}
>
{loadingStates.webhook ? (