Commit Graph

32 Commits

Author SHA1 Message Date
javayhu
e6bc1ea9e8 refactor: rename 'credits' to 'amount' in credit-related configurations and components for consistency 2025-08-24 01:16:39 +08:00
javayhu
669ac94bad chore: update comments to reflect renaming of enableForFreePlan to enablePackagesForFreePlan for clarity 2025-08-23 17:18:37 +08:00
javayhu
d319bd8af2 chore: rename enableForFreePlan to enablePackagesForFreePlan for clarity in credits configuration 2025-08-23 10:20:30 +08:00
javayhu
13c23dab56 refactor: migrate state management from Zustand to TanStack Query for improved data fetching and caching across components 2025-08-21 00:54:40 +08:00
javayhu
ac8d4dee4b refactor: replace usePayment hook and store with useCurrentPlan for improved payment state management 2025-08-21 00:50:12 +08:00
javayhu
90757475ac refactor: implement credits page with balance and transactions tabs 2025-08-18 00:29:56 +08:00
javayhu
0d04f6914e refactor: optimize credits rendering by memoizing and moving checks before hooks 2025-07-24 00:51:57 +08:00
javayhu
bc4578a3cd chore: remove credits disabled check in credits components 2025-07-24 00:04:42 +08:00
javayhu
7af313868c refactor: rename resetState to resetCreditsState and remove unused updateBalanceOptimistically method 2025-07-13 00:36:02 +08:00
javayhu
e3aa8eab55 feat: add support for free plan users in credit packages and update billing card layout 2025-07-12 20:23:23 +08:00
javayhu
ee341522f5 feat: enhance billing and credits management with new components and improved layout 2025-07-12 19:29:21 +08:00
javayhu
b5997ded4c feat: add payment success message and improve billing card layout 2025-07-12 17:03:16 +08:00
javayhu
367965e41f feat: ensure handler session id only once in credit package 2025-07-12 12:46:57 +08:00
javayhu
9d4fcbe36d refactor: remove useCreditTransactionStore and related logic from credits components, streamline useCredits integration 2025-07-11 01:35:31 +08:00
javayhu
e6663b013d refactor: replace getCreditBalanceAction with useCredits hook in credits-related components 2025-07-11 01:10:43 +08:00
javayhu
0b6f81aca6 refactor: replace useTransactionStore with useCreditTransactionStore in credit-related components 2025-07-10 23:27:43 +08:00
javayhu
de1ccca27b feat: implement consume credits action and get credit balance action, update credits balance references 2025-07-10 22:00:33 +08:00
javayhu
3872a9d422 refactor: remove session_id from URL parameters in CreditPackages component 2025-07-10 19:20:11 +08:00
javayhu
2e0a195a2a refactor: update URL handling in CreditPackages component 2025-07-10 16:48:29 +08:00
javayhu
6c1a4685cd refactor: add disabled to credits config 2025-07-10 16:30:56 +08:00
javayhu
f649db26ae feat: add CreditsBalanceButton and CreditsBalanceMenu components 2025-07-10 15:41:11 +08:00
javayhu
e011d09803 feat: enhance CreditPackages component with loading indicator 2025-07-10 10:54:07 +08:00
javayhu
3e0861f883 fix: update sidebar rendering logic and enhance credit package success toast
- Updated DashboardSidebar to conditionally render SidebarMain based on loading state.
- Modified CreditPackages to trigger a refresh of credits data and show success toast with a delay to avoid React lifecycle conflicts.
2025-07-09 21:58:35 +08:00
javayhu
a7738f0cbf feat: implement credit checkout session and enhance credit package management
- Added new credit checkout session functionality to facilitate credit purchases.
- Introduced credit package configurations in env.example for better management.
- Updated English and Chinese JSON files with new messages for checkout processes.
- Refactored existing components to utilize the new credit checkout session and streamline the credit purchasing workflow.
- Removed obsolete payment intent handling to simplify the codebase.
2025-07-09 00:22:07 +08:00
javayhu
73ce18f564 refactor: update credit package descriptions and improve component structure
- Revised credit package descriptions in the English JSON file for clarity and consistency.
- Refactored CreditPackages component to utilize a more efficient method for retrieving credit packages.
- Removed obsolete functions and streamlined the code for better maintainability and performance.
2025-07-07 01:10:06 +08:00
javayhu
e430a0c319 feat: implement credit packages management with translations and server integration
- Added new credit packages structure in English and Chinese JSON files for better localization.
- Introduced server-side functions to retrieve credit packages and package details.
- Updated client-side components to utilize new credit package retrieval methods.
- Refactored existing code to enhance modularity and maintainability by separating client and server logic.
- Removed obsolete credit package retrieval functions to streamline the codebase.
2025-07-07 00:47:43 +08:00
javayhu
f7f7be2ef0 feat: add credits config in website config
- Added a new credits management system with configurable credit packages in website.tsx.
- Replaced hardcoded credit package definitions with a dynamic retrieval system using getCreditPackages and getCreditPackageById functions.
- Updated CreditPackages and StripePaymentForm components to utilize the new credit package structure.
- Removed obsolete CREDIT_PACKAGES constant from constants.ts to streamline the codebase.
- Enhanced type definitions for credit packages in types.ts for better clarity and maintainability.
- Updated README.md to reflect changes in credit packages configuration.
2025-07-07 00:04:45 +08:00
javayhu
d9cda3e122 feat: enhance credits settings with tabbed interface and improved translations
- Implemented a tabbed interface in the CreditsPage component to separate balance and transactions views.
- Updated CreditPackages and CreditTransactionsPageClient components to utilize the new tab structure.
- Enhanced translation support for credits-related messages in both English and Chinese.
- Improved error handling and user feedback in credit-related components.
- Refactored CreditTransactionsTable to utilize translations for table headers and pagination controls.
2025-07-06 17:17:24 +08:00
javayhu
75083b32e4 refactor: reorganize credit-related imports and enhance user feedback
- Updated import paths for credit-related actions and functions to improve module organization.
- Removed redundant refresh trigger declaration in CreditPackages component.
- Simplified success toast message in CreditPackages and PaymentForm components for clarity.
- Introduced a new credits.ts file to centralize credit management logic and improve maintainability.
2025-07-06 00:15:07 +08:00
javayhu
e933844479 feat: enhance credit management with transaction store and UI updates
- Added a new transaction store to manage refresh triggers for credit-related components.
- Updated CreditPackages and StripePaymentForm components to utilize the transaction store for refreshing UI after credit purchases.
- Modified .gitignore to include certificates.
- Introduced a new script in package.json for running the development server with HTTPS support.
2025-07-05 23:59:30 +08:00
javayhu
13bee49f90 feat: add credits section to avatar configuration and update translations
- Added "Credits" entry to the avatar configuration for navigation.
- Updated English and Chinese translation files to include "Credits" label.
- Refactored error messages in credit payment actions for clarity.
- Enhanced loading state management in CreditPackages component.
- Replaced icons in CreditPackages component for improved UI consistency.
2025-07-05 23:25:37 +08:00
javayhu
fe2b1bbe39 feat: add credit purchase functionality with Stripe integration
- Introduced credit purchase payment intent actions in credits.action.ts.
- Created new components for credit packages and Stripe payment form.
- Added routes and layout for credits settings page.
- Updated sidebar configuration to include credits settings.
- Enhanced constants for credit packages with detailed pricing and descriptions.
- Implemented loading and layout components for credits page.
- Integrated payment confirmation handling in Stripe provider.
2025-07-05 22:30:22 +08:00