1
0
mirror of https://github.com/lexogrine/cs2-react-hud.git synced 2026-05-04 12:13:11 +02:00

initial commit

This commit is contained in:
Hubert Walczak
2023-09-11 12:37:32 +02:00
commit 989ede8638
247 changed files with 7656 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import React from 'react';
import CameraContainer from '../Camera/Container';
import PlayerCamera from "./../Camera/Camera";
import { avatars } from './../../api/avatars';
import { Skull } from './../../assets/Icons';
interface IProps {
steamid: string,
slot?: number,
height?: number,
width?: number,
showSkull?: boolean,
showCam?: boolean,
sidePlayer?: boolean
}
export default class Avatar extends React.Component<IProps> {
render() {
const { showCam, steamid, width, height, showSkull, sidePlayer } = this.props;
//const url = avatars.filter(avatar => avatar.steamid === this.props.steamid)[0];
const avatarData = avatars[this.props.steamid];
if (!avatarData || !avatarData.url) {
return null;
}
return (
<div className={`avatar`}>
{
showCam ? ( sidePlayer ? <div className="videofeed"><PlayerCamera steamid={steamid} visible={true} /></div> : <CameraContainer observedSteamid={steamid} />) : null
}
{
showSkull ? <Skull height={height} width={width} /> : <img src={avatarData.url} height={height} width={width} alt={'Avatar'} />
}
</div>
);
}
}