{"size": 979, "ext": "js", "max_stars_repo_path": "src/views/cattab/CatTestsTab.js", "max_stars_repo_name": "Riccardo-Camuffo-1962/pannello-anfi", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/views/cattab/CatTestsTab.js", "max_issues_repo_name": "Riccardo-Camuffo-1962/pannello-anfi", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/views/cattab/CatTestsTab.js", "max_forks_repo_name": "Riccardo-Camuffo-1962/pannello-anfi", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.8, "max_line_length": 61, "alphanum_fraction": 0.6312563841}
import { Component } from "react";
import { withRouter } from 'react-router-dom';

import { Container } from 'reactstrap';

import getCatTests		from "libs/cat_tests.js"
import CatTestsTable	from "components/Cats/CatTestsTable.js";

class CatTestsTab extends Component
{
	constructor( props )
	{
		super( props );

		this.state = {
			loaded : false,
			cat: props.cat,
			current_page: 1,
			last_page: 0,
			total: 0,
			data: [],
		};

		this.getData( props.cat.id );
	}

	async getData( id )
	{
		await getCatTests( 1, this, id );	// Prima pagina
	}

	render()
	{
		if( this.state.loaded === false )
			return null;
		else
			return (
			<>
				<Container fluid style={{marginTop: "20px" }}>
				<CatTestsTable 
					cat={this.state.cat}
					title=''
					total={this.state.total} 
					current_page={this.state.current_page}
					last_page={this.state.last_page}
					data={this.state.data}
				/>
				</Container>
			</>
			);
	}
}

export default withRouter(CatTestsTab);
