diff --git a/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx b/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx index 1100653c0..cc3440295 100644 --- a/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx +++ b/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx @@ -56,6 +56,7 @@ import { import { IconDeviceFloppy } from "@tabler/icons-react"; import CopyButton from "./CopyButton"; import AIConfigEditorThemeProvider from "../themes/AIConfigEditorThemeProvider"; +import ShareButton from "./global/ShareButton"; import PromptsContainer from "./prompt/PromptsContainer"; type Props = { @@ -155,10 +156,8 @@ export default function AIConfigEditor({ return; } try { - // TODO: While uploading, show a loader state for share button const { share_url: shareUrl } = await shareCallback(); - // TODO: display the shareUrl in a dialog - // console.log("Share URL: ", shareUrl); + return shareUrl; } catch (err: unknown) { const message = (err as RequestCallbackError).message ?? null; showNotification({ @@ -962,19 +961,7 @@ export default function AIConfigEditor({ {!readOnly && ( - {shareCallback && ( - - - - )} - + {shareCallback && } {onClearOutputs && ( + ); + + const tooltipMessage: string = isLoading + ? "Generating share link..." + : "Create a link to share your AIConfig!"; + return ( + +
{button}
+
+ ); +});