80a1ffbe4d
Apps share the same backend, API keys, and publishing flow but each gets its own branding (name, colors, icon, app URL), knowledge files (brand identity, product info, platform guidelines), and campaigns. The pipeline dynamically writes _knowledge/ files and copies app assets before each run. - Add App model with slug, colors, appUrl, and knowledge markdown fields - Add appId FK to Campaign, seed honeyDue as first app with existing knowledge - App switcher dropdown in sidebar with icon previews - Filter campaigns, stats, and assets by active app (cookie-based) - De-hardcode lib/claude.ts: AppConfig interface, templated prompts, dynamic _knowledge/ and Remotion asset copying - App management pages (list, create, edit) with icon upload and color pickers - Asset library sort options (newest, oldest, name, platform, type) - Asset cards show creation date - Remotion HoneyDueAd accepts colors/appName props Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
607 B
TypeScript
32 lines
607 B
TypeScript
"use client";
|
|
|
|
import { createContext, useContext } from "react";
|
|
|
|
export interface AppData {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
description: string | null;
|
|
primaryColor: string;
|
|
accentColor: string;
|
|
darkBg: string;
|
|
}
|
|
|
|
interface ActiveAppContextValue {
|
|
apps: AppData[];
|
|
activeApp: AppData | null;
|
|
setActiveApp: (slug: string) => void;
|
|
loading: boolean;
|
|
}
|
|
|
|
export const ActiveAppContext = createContext<ActiveAppContextValue>({
|
|
apps: [],
|
|
activeApp: null,
|
|
setActiveApp: () => {},
|
|
loading: true,
|
|
});
|
|
|
|
export function useActiveApp() {
|
|
return useContext(ActiveAppContext);
|
|
}
|