Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: fix ugc

Nevo David4ecc0c275c08
diff --git a/apps/frontend/src/components/layout/agent.media.modal.tsx b/apps/frontend/src/components/layout/agent.media.modal.tsx
new file mode 100644
index 000000000..0ee5fa594
--- /dev/null
+++ b/apps/frontend/src/components/layout/agent.media.modal.tsx
@@ -0,0 +1,103 @@
+'use client';
+
+import { FC, useCallback, useState } from 'react';
+import { useModals } from '@gitroom/frontend/components/layout/new-modal';
+import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
+import { useT } from '@gitroom/react/translation/get.transation.service.client';
+import { Button } from '@gitroom/react/form/button';
+
+export const AgentMediaModal: FC = () => {
+ const fetch = useFetch();
+ const t = useT();
+ const { closeCurrent } = useModals();
+ const [loading, setLoading] = useState(false);
+
+ const handleContinue = useCallback(async () => {
+ setLoading(true);
+ try {
+ const response = await fetch('/user/agent-media-sso');
+ const data = await response.json();
+ if (data.url) {
+ window.open(data.url, '_blank');
+ }
+ closeCurrent();
+ } catch (e) {
+ // ignore
+ } finally {
+ setLoading(false);
+ }
+ }, [fetch, closeCurrent]);
+
+ return (
+ <div className="flex flex-col gap-[20px] max-w-[520px]">
+ <div className="text-[14px] leading-[22px] text-newTextColor opacity-80">
+ {t(
+ 'agent_media_different_company',
+ 'UGC videos are powered by AgentMedia (agent-media.ai), a separate product with its own account and pricing β€” not part of your Postiz subscription.'
+ )}
+ </div>
+
+ <div className="flex flex-col gap-[12px]">
+ <div className="text-[14px] font-[600] text-newTextColor">
+ {t('agent_media_what_you_get', 'What you get with AgentMedia')}
+ </div>
+ <ul className="flex flex-col gap-[8px] text-[14px] leading-[20px] text-newTextColor opacity-80">
+ <li className="flex gap-[8px]">
+ <span className="text-forth">β€’</span>
+ <span>
+ {t(
+ 'agent_media_feature_videos',
+ 'AI-generated UGC videos with captions written and baked in automatically'
+ )}
+ </span>
+ </li>
+ <li className="flex gap-[8px]">
+ <span className="text-forth">β€’</span>
+ <span>
+ {t(
+ 'agent_media_feature_quality',
+ 'Studio-quality 9:16 vertical video at 1080p'
+ )}
+ </span>
+ </li>
+ <li className="flex gap-[8px]">
+ <span className="text-forth">β€’</span>
+ <span>
+ {t(
+ 'agent_media_feature_publish',
+ 'Auto-publishing to TikTok, Instagram, YouTube and X'
+ )}
+ </span>
+ </li>
+ </ul>
+ </div>
+
+ <div className="flex flex-col gap-[12px]">
+ <div className="text-[14px] font-[600] text-newTextColor">
+ {t('agent_media_pricing', 'Separate pricing')}
+ </div>
+ <div className="flex flex-col gap-[6px] text-[14px] leading-[20px] text-newTextColor opacity-80">
+ <div>
+ {t('agent_media_plan_creator', 'Creator β€” $39/mo Β· 3,900 credits')}
+ </div>
+ <div>{t('agent_media_plan_pro', 'Pro β€” $69/mo Β· 6,900 credits')}</div>
+ <div>
+ {t(
+ 'agent_media_plan_pro_plus',
+ 'Pro Plus β€” $129/mo Β· 12,900 credits + early access'
+ )}
+ </div>
+ </div>
+ </div>
+
+ <div className="flex gap-[12px] mt-[8px]">
+ <Button loading={loading} onClick={handleContinue}>
+ {t('agent_media_continue', 'Continue to AgentMedia')}
+ </Button>
+ <Button secondary={true} onClick={closeCurrent}>
+ {t('cancel', 'Cancel')}
+ </Button>
+ </div>
+ </div>
+ );
+};
diff --git a/apps/frontend/src/components/layout/top.menu.tsx b/apps/frontend/src/components/layout/top.menu.tsx
index 01d0c96fc..defa47bb6 100644
--- a/apps/frontend/src/components/layout/top.menu.tsx
+++ b/apps/frontend/src/components/layout/top.menu.tsx
@@ -4,8 +4,9 @@ import { FC, ReactNode, useCallback } from 'react';
import { useUser } from '@gitroom/frontend/components/layout/user.context';
import { useVariables } from '@gitroom/react/helpers/variable.context';
import { useT } from '@gitroom/react/translation/get.transation.service.client';
-import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import { MenuItem } from '@gitroom/frontend/components/new-layout/menu-item';
+import { useModals } from '@gitroom/frontend/components/layout/new-modal';
+import { AgentMediaModal } from '@gitroom/frontend/components/layout/agent.media.modal';
interface MenuItemInterface {
name: string;
@@ -20,19 +21,16 @@ interface MenuItemInterface {
export const useMenuItem = () => {
const { isGeneral } = useVariables();
const t = useT();
- const fetch = useFetch();
+ const { openModal } = useModals();
- const handleAgentMediaClick = useCallback(async () => {
- try {
- const response = await fetch('/user/agent-media-sso');
- const data = await response.json();
- if (data.url) {
- window.open(data.url, '_blank');
- }
- } catch (e) {
- // ignore
- }
- }, [fetch]);
+ const handleAgentMediaClick = useCallback(() => {
+ openModal({
+ title: t('agent_media_title', 'UGC videos by AgentMedia'),
+ closeOnClickOutside: true,
+ closeOnEscape: true,
+ children: <AgentMediaModal />,
+ });
+ }, [openModal, t]);
const firstMenu = [
{