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