From ab6b6cc4be8f6a49da18268ddcf732461b9b4c70 Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Sun, 16 Nov 2025 19:06:48 +0000 Subject: [PATCH] Phase 0: Add credit costs display to Credits page - Added credit costs reference table to Credits page - Shows cost per operation type with descriptions - Consistent with Usage page credit costs display - Helps users understand credit consumption --- frontend/src/pages/Billing/Credits.tsx | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/frontend/src/pages/Billing/Credits.tsx b/frontend/src/pages/Billing/Credits.tsx index 1aeea780..bb7e66b0 100644 --- a/frontend/src/pages/Billing/Credits.tsx +++ b/frontend/src/pages/Billing/Credits.tsx @@ -5,6 +5,19 @@ import { fetchCreditBalance, CreditBalance } from '../../services/api'; import { Card } from '../../components/ui/card'; import Badge from '../../components/ui/badge/Badge'; +// Credit costs per operation (Phase 0: Credit-only system) +const CREDIT_COSTS: Record = { + clustering: { cost: 10, description: 'Per clustering request' }, + idea_generation: { cost: 15, description: 'Per cluster → ideas request' }, + content_generation: { cost: '1 per 100 words', description: 'Per 100 words generated' }, + image_prompt_extraction: { cost: 2, description: 'Per content piece' }, + image_generation: { cost: 5, description: 'Per image generated' }, + linking: { cost: 8, description: 'Per content piece' }, + optimization: { cost: '1 per 200 words', description: 'Per 200 words optimized' }, + site_structure_generation: { cost: 50, description: 'Per site blueprint' }, + site_page_generation: { cost: 20, description: 'Per page generated' }, +}; + export default function Credits() { const toast = useToast(); const [balance, setBalance] = useState(null); @@ -88,6 +101,35 @@ export default function Credits() { )} + + {/* Credit Costs Reference */} +
+ +

Credit Costs per Operation

+

+ Understanding how credits are consumed for each operation type +

+
+ {Object.entries(CREDIT_COSTS).map(([operation, info]) => ( +
+
+
+ {operation.replace(/_/g, ' ')} +
+
+ {info.description} +
+
+
+ + {typeof info.cost === 'number' ? `${info.cost} credits` : info.cost} + +
+
+ ))} +
+
+
); }