import React, { FC, useCallback } from 'react'; import { Group } from '~/components/containers/Group'; import { Icon } from '~/components/input/Icon'; import { PRESETS } from '~/constants/urls'; import { IUser } from '~/types/auth'; import { getURL } from '~/utils/dom'; import styles from './styles.module.scss'; interface IProps { user: Partial; onLogout: () => void; authOpenProfile: () => void; } const UserButton: FC = ({ user: { username, photo }, authOpenProfile, onLogout }) => { const onProfileOpen = useCallback(() => { authOpenProfile(); }, [authOpenProfile]); const onSettingsOpen = useCallback(() => { authOpenProfile(); }, [authOpenProfile]); return (
{username}
{(!photo || !photo.id) && }
Профиль
Настройки
Выдох
); }; export { UserButton };