1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00
vault-frontend/src/components/boris/Superpower/index.tsx
2021-11-21 17:34:32 +07:00

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 };