From 7dfbe0f363a434cfda5f9be996d194f03c36879c Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Wed, 31 Jul 2024 12:16:49 +0530 Subject: new project --- panel/src/components/PrivateRoute.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 panel/src/components/PrivateRoute.jsx (limited to 'panel/src/components') diff --git a/panel/src/components/PrivateRoute.jsx b/panel/src/components/PrivateRoute.jsx new file mode 100644 index 0000000..04e00f7 --- /dev/null +++ b/panel/src/components/PrivateRoute.jsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { Navigate, Outlet } from 'react-router-dom'; +import { useAuth } from '../contexts/AuthContext'; + +const PrivateRoute = () => { + const { currentUser } = useAuth(); + return currentUser ? : ; +}; + +export default PrivateRoute; -- cgit v1.2.3-59-g8ed1b