mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 04:45:08 +03:00
### Summary This PR updates the logic to include `prepaid_credits_balance` while showing the existing customer balance. This changes the credit balance shown in: - Billing Settings > Credit Balance - Credit code redemption modal The displayed amount now reflects the total credit balance across prepaid credits and the customer balance. ### Testing - Open an org billing page with prepaid credits and verify Credit Balance includes both sources. - Open the credit redemption modal and verify Current Balance matches the combined credit amount. - Verify an org with only customer balance still shows the same credit amount as before. - Verify an org with only prepaid credits balance and no customer balance now shows credits correctly. - Verify an org with no credits shows 0.00 and does not show /credits. - Verify an org where net balance is debt still shows a negative amount without the /credits suffix. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Credit balance display now includes purchased and prorated credits for a complete account view. * Credit redemption and current-balance screens now show combined credit totals (prepaid + existing) for clearer availability. * UI descriptive text clarified to explain how credits are applied and how charges occur once credits are exhausted. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Writing components
Where to create your components
- For components that declare the general structure and layout of a page:
/components/layouts/xxx
- For components that are tightly coupled to a specific interface:
/components/interfaces/xxx
- For components that are meant to be reusable across multiple pages:
/components/ui/xxx
- Note: We're gradually moving files out of the
to-be-cleanedfolder into the respective folders as we refactor
Component structure
- If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an
index.tsxas an entry point - Otherwise it can just be a file on its own
- For example:
-
components/ui - SampleComponentA - SampleComponentA.tsx - SampleComponentA.constants.ts - SampleComponentA.utils.ts - SampleComponentA.types.ts - index.ts - SampleComponentB.tsx
-
Template for building components
// Declare the prop types of your component
interface ComponentAProps {
sampleProp: string
}
// Name your component accordingly
const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}
export default ComponentA