2022-06-05 20:38:12 +02:00
|
|
|
import React from 'react';
|
|
|
|
import {useDataRequest} from "../../hooks/dataFetchHook";
|
|
|
|
import {useParams} from "react-router-dom";
|
|
|
|
import {fetchPlayers} from "../../service/serverService";
|
|
|
|
import ErrorView from "../ErrorView";
|
2023-02-06 18:01:33 +01:00
|
|
|
import {Col, Row} from "react-bootstrap";
|
2022-06-05 20:38:12 +02:00
|
|
|
import PlayerListCard from "../../components/cards/common/PlayerListCard";
|
2022-08-19 18:03:02 +02:00
|
|
|
import LoadIn from "../../components/animation/LoadIn";
|
2022-06-05 20:38:12 +02:00
|
|
|
|
|
|
|
const ServerPlayers = () => {
|
|
|
|
const {identifier} = useParams();
|
|
|
|
|
|
|
|
const {data, loadingError} = useDataRequest(fetchPlayers, [identifier]);
|
|
|
|
|
|
|
|
if (loadingError) return <ErrorView error={loadingError}/>
|
|
|
|
|
|
|
|
return (
|
2022-08-19 18:03:02 +02:00
|
|
|
<LoadIn>
|
|
|
|
<section className="server_players">
|
|
|
|
<Row>
|
|
|
|
<Col md={12}>
|
|
|
|
<PlayerListCard data={data}/>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</section>
|
|
|
|
</LoadIn>
|
2022-06-05 20:38:12 +02:00
|
|
|
)
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ServerPlayers
|