diff --git a/components/ArtistSetting/ArtistConnectorsTab.tsx b/components/ArtistSetting/ArtistConnectorsTab.tsx index 50173bf9b..c3e792f98 100644 --- a/components/ArtistSetting/ArtistConnectorsTab.tsx +++ b/components/ArtistSetting/ArtistConnectorsTab.tsx @@ -1,8 +1,11 @@ "use client"; import { useMemo } from "react"; +import { useQuery } from "@tanstack/react-query"; import { useConnectors } from "@/hooks/useConnectors"; import { ALLOWED_ARTIST_CONNECTORS } from "@/lib/composio/allowedArtistConnectors"; +import { getArtistSocials } from "@/lib/api/artist/getArtistSocials"; +import { matchSocialToConnector } from "@/lib/composio/matchSocialToConnector"; import { ConnectorCard } from "@/components/ConnectorsPage/ConnectorCard"; import { Loader2, Plug } from "lucide-react"; @@ -14,15 +17,29 @@ interface ArtistConnectorsTabProps { * Connectors tab content for the Artist Settings modal. * Reuses ConnectorCard from the user-level ConnectorsPage (DRY). */ -export function ArtistConnectorsTab({ artistAccountId }: ArtistConnectorsTabProps) { - const config = useMemo(() => ({ - accountId: artistAccountId, - allowedSlugs: [...ALLOWED_ARTIST_CONNECTORS], - callbackUrl: `${window.location.origin}${window.location.pathname}?artist_connected=true&artist_id=${artistAccountId}`, - }), [artistAccountId]); +export function ArtistConnectorsTab({ + artistAccountId, +}: ArtistConnectorsTabProps) { + const config = useMemo( + () => ({ + accountId: artistAccountId, + allowedSlugs: [...ALLOWED_ARTIST_CONNECTORS], + callbackUrl: `${window.location.origin}${window.location.pathname}?artist_connected=true&artist_id=${artistAccountId}`, + }), + [artistAccountId], + ); const { connectors, isLoading, error, authorize, disconnect } = useConnectors(config); + const { data: socialsData } = useQuery({ + queryKey: ["artistSocials", artistAccountId], + queryFn: () => getArtistSocials(artistAccountId), + enabled: !!artistAccountId, + staleTime: 1000 * 60 * 5, + }); + + const socials = socialsData?.socials ?? []; + if (isLoading) { return (
- Connect third-party services so the AI agent can take actions on behalf of this artist. + Connect third-party services so the AI agent can take actions on behalf + of this artist.
- {meta.description} + {showSocialProfile && socialUsername + ? `@${socialUsername}` + : meta.description}