chore(ci): correct Gitea runner to runs-on ubuntu-24.04 and feat(billing): implement US-3.7 billing/subscription UX
Some checks failed
CI / Deploy production (on server) (push) Has been cancelled
CI / Lint, Unit Tests & Build (push) Has been cancelled

This commit is contained in:
Antigravity
2026-05-28 21:39:08 +00:00
parent 4bfa7c6b69
commit 3b2570d981
11 changed files with 180 additions and 71 deletions

View File

@@ -8,9 +8,10 @@ interface UseAutoTaggingProps {
content: string;
notebookId?: string | null;
enabled?: boolean;
onQuotaExceeded?: () => void;
}
export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoTaggingProps) {
export function useAutoTagging({ content, notebookId, enabled = true, onQuotaExceeded }: UseAutoTaggingProps) {
const { language } = useLanguage();
const { hasAiConsent, requestAiConsent } = useAiConsent();
const [suggestions, setSuggestions] = useState<TagSuggestion[]>([]);
@@ -62,6 +63,9 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT
if (controller.signal.aborted) return;
if (!response.ok) {
if (response.status === 402 && onQuotaExceeded) {
onQuotaExceeded();
}
throw new Error('Error during analysis');
}
@@ -75,7 +79,7 @@ export function useAutoTagging({ content, notebookId, enabled = true }: UseAutoT
setIsAnalyzing(false);
}
}
}, [hasAiConsent, requestAiConsent]);
}, [hasAiConsent, requestAiConsent, onQuotaExceeded]);
// Trigger on content change
useEffect(() => {