2026-04-10 21:53:50 +02:00
|
|
|
/**
|
|
|
|
|
* This file is part of the SplendidBear Websites' projects.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2026 @ www.splendidbear.org
|
|
|
|
|
*
|
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-04-10 17:57:26 +02:00
|
|
|
import React, { memo } from 'react';
|
2026-04-10 21:53:50 +02:00
|
|
|
import { IMAGES } from '@mine-utils';
|
2026-04-10 17:57:26 +02:00
|
|
|
|
2026-04-10 21:53:50 +02:00
|
|
|
const User = memo(function User(
|
|
|
|
|
{
|
|
|
|
|
color,
|
|
|
|
|
webPlayer,
|
|
|
|
|
name,
|
|
|
|
|
desc,
|
|
|
|
|
active,
|
|
|
|
|
mines,
|
|
|
|
|
haveBomb,
|
|
|
|
|
enabledBomb,
|
|
|
|
|
onClickBombSelector,
|
|
|
|
|
},
|
|
|
|
|
) {
|
2026-04-10 17:57:26 +02:00
|
|
|
const buzzClass = 'bomb-container'
|
|
|
|
|
+ (active && color === webPlayer && haveBomb && enabledBomb ? ' buzz' : '');
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={`user-container user-${color}`}>
|
|
|
|
|
<div className="user-header">
|
|
|
|
|
<div className="user-color">{color}</div>
|
2026-04-10 19:09:05 +02:00
|
|
|
{active && <img src={IMAGES.cursor(color)} alt="" className="user-cursor" />}
|
|
|
|
|
<img src={IMAGES.figure(color)} alt="" />
|
2026-04-10 17:57:26 +02:00
|
|
|
</div>
|
|
|
|
|
<div className="user-name"> {name} </div>
|
|
|
|
|
<div className="user-caret"><i className="fa fa-caret-down" /></div>
|
|
|
|
|
<div className="user-desc"> {desc} </div>
|
|
|
|
|
<div className="user-control">
|
2026-04-10 19:09:05 +02:00
|
|
|
<img src={IMAGES.flag(color)} alt="" />
|
2026-04-10 17:57:26 +02:00
|
|
|
<div className="user-control-mines">{mines}</div>
|
|
|
|
|
<div className={buzzClass} onClick={onClickBombSelector}>
|
2026-04-10 19:09:05 +02:00
|
|
|
<div className="bomb">
|
|
|
|
|
{haveBomb && <img src={enabledBomb && active ? IMAGES.bomb : IMAGES.bombDisabled} alt="" />}
|
|
|
|
|
{!haveBomb && <img src={IMAGES.bombExploded} alt="" />}
|
|
|
|
|
</div>
|
2026-04-10 17:57:26 +02:00
|
|
|
</div>
|
|
|
|
|
<div className="clear" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default User;
|