mnoga che sdelal

This commit is contained in:
aurinex
2025-12-13 22:17:17 +05:00
parent abb45c3838
commit ca8ac8e880
9 changed files with 302 additions and 190 deletions

View File

@ -3,6 +3,7 @@ import { Box, Typography } from '@mui/material';
import CustomTooltip from './Notifications/CustomTooltip';
import { useEffect, useState } from 'react';
import { fetchCoins } from '../api';
import type { SxProps, Theme } from '@mui/material/styles';
interface CoinsDisplayProps {
// Основные пропсы
@ -23,6 +24,8 @@ interface CoinsDisplayProps {
// Стилизация
backgroundColor?: string;
textColor?: string;
sx?: SxProps<Theme>;
}
export default function CoinsDisplay({
@ -44,6 +47,8 @@ export default function CoinsDisplay({
// Стилизация
backgroundColor = 'rgba(0, 0, 0, 0.2)',
textColor = 'white',
sx,
}: CoinsDisplayProps) {
const [coins, setCoins] = useState<number>(externalValue || 0);
const [isLoading, setIsLoading] = useState<boolean>(false);
@ -142,6 +147,8 @@ export default function CoinsDisplay({
cursor: showTooltip ? 'help' : 'default',
opacity: isLoading ? 0.7 : 1,
transition: 'opacity 0.2s ease',
...sx,
}}
onClick={username ? handleRefresh : undefined}
title={username ? 'Нажмите для обновления' : undefined}