UI: Construct and render stolen credentials

This commit is contained in:
Ilija Lazoroski 2022-07-14 16:49:31 +02:00
parent 2861f0b085
commit f99bd74cd4
1 changed files with 5 additions and 4 deletions

View File

@ -1,13 +1,13 @@
import React from 'react'; import React from 'react';
import ReactTable from 'react-table' import ReactTable from 'react-table'
import {getCredentialsTableData} from '../credentialParsing.js';
const columns = [ const columns = [
{ {
Header: 'Stolen Credentials', Header: 'Stolen Credentials',
columns: [ columns: [
{Header: 'Username', accessor: 'username'}, {Header: 'Username', accessor: 'username'},
{Header: 'Type', accessor: 'type'}, {Header: 'Type', accessor: 'type'}
{Header: 'Stolen From', accessor: 'origin'}
] ]
} }
]; ];
@ -22,11 +22,12 @@ class StolenPasswordsComponent extends React.Component {
render() { render() {
let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length; let defaultPageSize = this.props.data.length > pageSize ? pageSize : this.props.data.length;
let showPagination = this.props.data.length > pageSize; let showPagination = this.props.data.length > pageSize;
let table_data = getCredentialsTableData(this.props.data);
return ( return (
<div className="data-table-container"> <div className="data-table-container">
<ReactTable <ReactTable
columns={columns} columns={columns}
data={this.props.data} data={table_data}
showPagination={showPagination} showPagination={showPagination}
defaultPageSize={defaultPageSize} defaultPageSize={defaultPageSize}
/> />