Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
acharliekelly committed Oct 15, 2021
1 parent 8a6c397 commit e3e9ede
Showing 1 changed file with 75 additions and 76 deletions.
151 changes: 75 additions & 76 deletions frontend/compositions/search-results/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,85 +121,84 @@ export default function SearchResultsTable({ incidents = mockData }: SearchResul
)

return (
<table {...getTableProps()} className={dataTable} aria-label="Search Results">
<thead className={dataHeader}>
{headerGroups.map((headerGroup) => (
// eslint-disable-next-line react/jsx-key
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
// eslint-disable-next-line react/jsx-key
<th {...column.getHeaderProps(column.getSortByToggleProps())}>
{column.render("Header")}
<span className={sortArrow}>
{column.isSorted ? (
column.isSortedDesc ? (
<FontAwesomeIcon icon={faArrowDown} />
) : (
<FontAwesomeIcon icon={faArrowUp} />
)
) : (
" "
)}
</span>
{showFilters && (
<div className={styles.colFilter}>
{column.canFilter ? column.render("Filter") : null}
</div>
)}
</th>
))}
</tr>
))}
</thead>
<tbody {...getTableBodyProps()}>
{page.map((row) => {
prepareRow(row)
return (
<table {...getTableProps()} className={dataTable} aria-label="Search Results">
<thead className={dataHeader}>
{headerGroups.map((headerGroup) => (
// eslint-disable-next-line react/jsx-key
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
// eslint-disable-next-line react/jsx-key
<tr {...row.getRowProps()} className={dataRows}>
{row.cells.map((cell) => {
if (cell.column.id === "id") {
return (
<td>
<FontAwesomeIcon
className={actionBtn}
title="Save Record"
icon={faPlusCircle}
onClick={() => saveRecord(cell.value)}
/>
</td>
<th {...column.getHeaderProps(column.getSortByToggleProps())}>
{column.render("Header")}
<span className={sortArrow}>
{column.isSorted ? (
column.isSortedDesc ? (
<FontAwesomeIcon icon={faArrowDown} />
) : (
<FontAwesomeIcon icon={faArrowUp} />
)
}
) : (
" "
)}
</span>
{showFilters && (
<div className={styles.colFilter}>
{column.canFilter ? column.render("Filter") : null}
</div>
)}
</th>
))}
</tr>
))}
</thead>
<tbody {...getTableBodyProps()}>
{page.map((row) => {
prepareRow(row)
return (
// eslint-disable-next-line react/jsx-key
<tr {...row.getRowProps()} className={dataRows}>
{row.cells.map((cell) => {
if (cell.column.id === "id") {
return (
// eslint-disable-next-line react/jsx-key
<td {...cell.getCellProps()}>{cell.render("Cell")}</td>
<td>
<FontAwesomeIcon
className={actionBtn}
title="Save Record"
icon={faPlusCircle}
onClick={() => saveRecord(cell.value)}
/>
</td>
)
})}
</tr>
)
})}
</tbody>
<tfoot className={dataFooter}>
<tr>
<td className={recordCount}>
<strong>{data.length.toLocaleString()} records found</strong>
</td>
<td colSpan={2} />
<td colSpan={2}>
<button className={pageBtn} onClick={() => previousPage()} disabled={!canPreviousPage}>
<FontAwesomeIcon icon={faAngleLeft} />
</button>
<span className={pageCnt}>
{pageIndex + 1} of {pageOptions.length}
</span>
<button className={pageBtn} onClick={() => nextPage()} disabled={!canNextPage}>
<FontAwesomeIcon icon={faAngleRight} />
</button>
</td>
<td />
</tr>
</tfoot>

</table>
}
return (
// eslint-disable-next-line react/jsx-key
<td {...cell.getCellProps()}>{cell.render("Cell")}</td>
)
})}
</tr>
)
})}
</tbody>
<tfoot className={dataFooter}>
<tr>
<td className={recordCount}>
<strong>{data.length.toLocaleString()} records found</strong>
</td>
<td colSpan={2} />
<td colSpan={2}>
<button className={pageBtn} onClick={() => previousPage()} disabled={!canPreviousPage}>
<FontAwesomeIcon icon={faAngleLeft} />
</button>
<span className={pageCnt}>
{pageIndex + 1} of {pageOptions.length}
</span>
<button className={pageBtn} onClick={() => nextPage()} disabled={!canNextPage}>
<FontAwesomeIcon icon={faAngleRight} />
</button>
</td>
<td />
</tr>
</tfoot>
</table>
)
}

0 comments on commit e3e9ede

Please sign in to comment.