spacedrive/interface/components/AuthCheck.tsx
Brendan Allan 25fa1f0974
[ENG-1255] Feedback popover with new API (#1532)
* feedback popover with new api

* allow unauthed feedback

* add login information

* allow no auth

* fix hooks

* remove emoji on reset

* show cancel on left of login button
2023-10-13 08:08:07 +00:00

11 lines
322 B
TypeScript

import { PropsWithChildren, ReactNode } from 'react';
import { auth } from '@sd/client';
export function AuthCheck({ fallback, children }: PropsWithChildren<{ fallback?: ReactNode }>) {
const authState = auth.useStateSnapshot();
if (authState.status !== 'loggedIn') return <>{fallback}</>;
return <>{children}</>;
}