dev1/src/components/UpsellSummary.js

36 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// UpsellSummary.jsx
import { Button } from './ui/button.js';
export default function UpsellSummary({ row, onUpgrade, isPremium }) {
if (!row) return null;
const niceMoney = n => '$' + Number(n).toLocaleString();
return (
<div id="loan-results" className="mt-6 space-y-3 border-t pt-4">
<p className="text-sm text-gray-700">
With a payment of <strong>{niceMoney(row.totalMonthlyPayment)}/mo</strong>{' '}
youd spend <strong>{niceMoney(row.totalLoanCost)}</strong> over the loan
term and still net about{' '}
<strong className="text-green-600">
{niceMoney(row.netGain)}
</strong>{' '}
after pay-off.
</p>
{isPremium ? (
<Button className="w-full" onClick={onUpgrade}>
Open Detailed ROI Planner
</Button>
) : (
<Button
className="w-full bg-green-500 hover:bg-green-600"
onClick={onUpgrade}
>
See full ROI with Premium
</Button>
)}
</div>
);
}