import React, { useState } from "react"; import { ROISummaryIcon } from "../../icons/analysis"; import SemiCircleProgress from "./SemiCircleProgress"; const ROISummary = ({ roiSummaryData = { productName: "Product name", roiPercentage: 133, paybackPeriod: 50.3, totalCost: "₹ 1,20,000", revenueGenerated: "₹ 2,80,000", netProfit: "₹ 1,60,000", costBreakdown: [ { item: "Raw Material A", unitCost: "₹ 10/unit", laborCost: "₹ 0", totalCost: "₹ 1000", sellingPrice: "₹ 1500", }, { item: "Labor", unitCost: "₹ 10/unit", laborCost: "₹ 500", totalCost: "₹ 500", sellingPrice: "N/A", }, { item: "Product 1", unitCost: "₹ 10/unit", laborCost: "₹ 200", totalCost: "₹ 200", sellingPrice: "₹ 2000", }, { item: "Machine", unitCost: "-", laborCost: "-", totalCost: "₹ 20,000", sellingPrice: "N/A", }, { item: "Total", unitCost: "-", laborCost: "-", totalCost: "₹ 1,20,000", sellingPrice: "-", }, { item: "Net Profit", unitCost: "-", laborCost: "-", totalCost: "₹ 1,60,000", sellingPrice: "-", }, ], }, }) => { const [isTableOpen, setIsTableOpen] = useState(false); // State to handle the table open/close // Function to toggle the breakdown table visibility const toggleTable = () => { setIsTableOpen(!isTableOpen); }; return (
ROI Summary
From 24 November, 2025
Product :
{roiSummaryData.productName}
+{roiSummaryData.roiPercentage}% ROI with payback in just {roiSummaryData.paybackPeriod} months
you're on track to hit it by
July 2029
Total Cost Incurred {roiSummaryData.totalCost}
Revenue Generated {roiSummaryData.revenueGenerated}
Net Profit {roiSummaryData.netProfit}
Cost Breakdown
{isTableOpen ? "⌵" : "⌵"}
{roiSummaryData.costBreakdown.map((row, index) => ( ))}
Item Unit Cost Labor Cost Total Cost Selling Price
{row.item} {row.unitCost} {row.laborCost} {row.totalCost} {row.sellingPrice}
💡 How to improve ROI?
Increase CNC utilization by 10%{" "} to shave 0.5 months of payback period
); }; export default ROISummary;