mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
15 lines
362 B
TypeScript
15 lines
362 B
TypeScript
import React, { FC } from 'react';
|
|
import { useShallowSelect } from '~/utils/hooks/useShallowSelect';
|
|
import { selectUser } from '~/redux/auth/selectors';
|
|
|
|
interface IProps {}
|
|
|
|
const Authorized: FC<IProps> = ({ children }) => {
|
|
const user = useShallowSelect(selectUser);
|
|
|
|
if (!user.is_user) return null;
|
|
|
|
return <>{children}</>;
|
|
};
|
|
|
|
export { Authorized };
|