chore(ci): correct Gitea runner to runs-on ubuntu-24.04 and feat(billing): implement US-3.7 billing/subscription UX
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user