Fix ban screen
This commit is contained in:
@@ -10,6 +10,7 @@ interface BanInfo {
|
||||
|
||||
interface BannedScreenProps {
|
||||
banInfo: BanInfo
|
||||
onLogout?: () => void
|
||||
}
|
||||
|
||||
function formatDate(dateStr: string | null) {
|
||||
@@ -24,8 +25,9 @@ function formatDate(dateStr: string | null) {
|
||||
}) + ' (МСК)'
|
||||
}
|
||||
|
||||
export function BannedScreen({ banInfo }: BannedScreenProps) {
|
||||
const logout = useAuthStore((state) => state.logout)
|
||||
export function BannedScreen({ banInfo, onLogout }: BannedScreenProps) {
|
||||
const storeLogout = useAuthStore((state) => state.logout)
|
||||
const handleLogout = onLogout || storeLogout
|
||||
|
||||
const bannedAtFormatted = formatDate(banInfo.banned_at)
|
||||
const bannedUntilFormatted = formatDate(banInfo.banned_until)
|
||||
@@ -112,7 +114,7 @@ export function BannedScreen({ banInfo }: BannedScreenProps) {
|
||||
<NeonButton
|
||||
variant="secondary"
|
||||
size="lg"
|
||||
onClick={logout}
|
||||
onClick={handleLogout}
|
||||
icon={<LogOut className="w-5 h-5" />}
|
||||
>
|
||||
Выйти из аккаунта
|
||||
|
||||
Reference in New Issue
Block a user