Notes
Notes - notes.io |
import "./LargeClaims.css";
import { submissionData } from "../../../Shared/Redux/Slicers/SubmissionSlice";
import { useSelector } from 'react-redux'
import NewDataTable from "../../../Shared/Components/NewDataTable";
import Accordion from "../../../Shared/Components/Accordian";
import { useState } from "react";
const LargeClaims = ({ isLargeClaims }) => {
const data = useSelector(submissionData)
const { tableColumns: largeClaimsTableColumns } = data.LargeClaimsTable
const newDataLargeClaim = data.LargeClaimsTable.tableRows;
const { tableColumns: claimantyearColumns } = data.ClaimantData
const claimantyear = data.ClaimantData.tableRows
const additionalFieldsForLargeClaim = data.AdditionalFieldsForLargeClaim
console.log(additionalFieldsForLargeClaim, "nnn")
console.log(newDataLargeClaim, "nnn")
console.log(claimantyear, "nnn")
const dummyData = {
GWP: "$560,166",
AcquisitionExpense: 0.8,
NWP: "$448,133"
};
const [expandedRow, setExpandedRow] = useState(null);
const accordionTitles = ["CY", "PY1", "PY2", "PY3"];
const toggleRow = (index) => {
if (expandedRow === index) {
setExpandedRow(null); // Close the row if it's already expanded
} else {
setExpandedRow(index); // Expand the row
}
};
return (
<>
<div className="top-header-div">
<div className="info-item">
<strong > GWP: </strong>{dummyData.GWP}
</div>
<div className="info-item">
<strong> Acquisition Expense: </strong>{dummyData.AcquisitionExpense}
</div>
<div className="info-item">
<strong > NWP: </strong>{dummyData.NWP}
</div>
</div>
<div className="header-div-table">
<table className="custom-table">
<thead>
<tr>
{/* Add Accordion Column as the first column */}
<th>Accordian</th>
{largeClaimsTableColumns.map((column) => (
<th key={column.controlId}>{column.name}</th>
))}
</tr>
</thead>
<tbody>
{newDataLargeClaim.map((row, rowIndex) => (
<tr key={rowIndex}>
{/* Accordion Column on the Left */}
<td onClick={() => toggleRow(rowIndex)} style={{ cursor: 'pointer' }}>
<Accordion title={accordionTitles[rowIndex % accordionTitles.length]}> {/* Use a fixed title for each row */}
{expandedRow === rowIndex && (
<div>
<ul>
<li><strong>Loss Ratio:</strong> {row.loss_ratio}</li>
<li><strong>Contract Basis:</strong> {row.contract_basis}</li>
<li><strong>Claims Over Spec:</strong> {row.claims_Over_spec}</li>
<li><strong>Of Claimants Over Spec:</strong> {row.of_claimants_over_spec}</li>
</ul>
</div>
)}
</Accordion>
</td>
{/* Other Table Columns */}
{largeClaimsTableColumns.map((column, colIndex) => (
<td key={colIndex}>
{/* Display the data for each cell in the table */}
{row[column.controlId]}
</td>
))}
</tr>
))}
</tbody>
</table>
</div>
<div className="average-div"> <h5>Average</h5>
<h5>Expected Claimants over spec
</h5></div>
<div className="h4-div">
<h4>Claimant Year Over Year View
</h4>
</div>
<NewDataTable tableColumns={claimantyearColumns} tableRows={claimantyear} />
</>
);
};
export default LargeClaims;
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
