Files
shop-server/client/src/pages/me/ui/sections/SettingsPage.tsx
T
2026-05-23 18:47:35 +05:00

44 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Alert from '@mui/material/Alert'
import Box from '@mui/material/Box'
import Divider from '@mui/material/Divider'
import Stack from '@mui/material/Stack'
import Typography from '@mui/material/Typography'
import { useUnit } from 'effector-react'
import { $user } from '@/shared/model/auth'
import { AuthMethodsSection } from './AuthMethodsSection'
import { AvatarSection } from './AvatarSection'
import { DeleteAccountSection } from './DeleteAccountSection'
import { ProfileSection } from './ProfileSection'
export function SettingsPage() {
const user = useUnit($user)
if (!user) {
return <Alert severity="info">Нужно войти. Перейдите на страницу «Вход».</Alert>
}
return (
<Box>
<Typography variant="h4" gutterBottom>
Настройки
</Typography>
<Typography color="text.secondary" sx={{ mb: 3 }}>
Текущая почта: <b>{user.email}</b>
</Typography>
<Stack spacing={3} sx={{ maxWidth: 560 }}>
<ProfileSection />
<Divider />
<AvatarSection />
{!user.isAdmin && (
<>
<Divider />
<AuthMethodsSection />
</>
)}
<DeleteAccountSection />
</Stack>
</Box>
)
}