mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-21 17:46:42 +02:00
Move inactive projects out of active workspace: - bauntown (community website) - maerchenzauber (AI story generation) - memoro (voice memo app) - news (news aggregation) - nutriphi (nutrition tracking) - reader (reading app) - uload (URL shortener) - wisekeep (AI wisdom extraction) Update CLAUDE.md documentation: - Add presi to active projects - Document archived projects section - Update workspace configuration Archived apps can be re-activated by moving back to apps/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { useInsufficientCreditsInterceptor } from '../../src/hooks/useInsufficientCreditsInterceptor';
|
|
import { useInsufficientCreditsStore } from '../../src/stores/insufficientCreditsStore';
|
|
import InsufficientCreditsModal from './InsufficientCreditsModal';
|
|
|
|
/**
|
|
* Global handler for insufficient credits errors.
|
|
* This component should be mounted at the root level of the app.
|
|
* It intercepts 402 errors and displays the insufficient credits modal.
|
|
*/
|
|
export default function GlobalInsufficientCreditsHandler() {
|
|
// Set up the global fetch interceptor
|
|
useInsufficientCreditsInterceptor();
|
|
|
|
// Get modal state from the store
|
|
const { isModalVisible, requiredCredits, availableCredits, operation, closeModal } =
|
|
useInsufficientCreditsStore();
|
|
|
|
return (
|
|
<InsufficientCreditsModal
|
|
visible={isModalVisible}
|
|
requiredCredits={requiredCredits || 0}
|
|
availableCredits={availableCredits || 0}
|
|
operationType={operation === 'story_creation' ? 'story' : 'character'}
|
|
onClose={closeModal}
|
|
onGetCredits={() => {
|
|
// TODO: Navigate to credits purchase page
|
|
console.log('Navigate to credits purchase page');
|
|
closeModal();
|
|
}}
|
|
/>
|
|
);
|
|
}
|