import React, {useContext} from "react"; import {Coins, DollarSign} from "lucide-react"; import {AIUsageContext, AIUsageContextProps} from "@/context/AIUsageContext"; export default function CreditCounter({isCredit}: { isCredit: boolean }) { const {totalCredits, totalPrice}: AIUsageContextProps = useContext(AIUsageContext) if (isCredit) { return (
{Math.round(totalCredits)} crédits
); } return (
{totalPrice ? totalPrice.toFixed(2) : '0.00'}
); }