2024-09-02 15:44:49 +00:00
|
|
|
import { Layout, LayoutContent, LayoutHeader, ProtectedRoute } from "@/components";
|
2024-06-29 19:39:25 +00:00
|
|
|
import { PropsWithChildren } from "react";
|
2024-09-02 15:44:49 +00:00
|
|
|
import { Outlet, useLocation } from "react-router-dom";
|
2024-06-29 19:39:25 +00:00
|
|
|
import { QuotesProvider } from "./QuotesContext";
|
|
|
|
|
|
|
|
|
|
export const QuotesLayout = ({ children }: PropsWithChildren) => {
|
2024-09-02 15:44:49 +00:00
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
|
|
const isEditing = location.pathname.includes("/edit");
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<ProtectedRoute>
|
|
|
|
|
<QuotesProvider>
|
|
|
|
|
<Layout>
|
|
|
|
|
<LayoutHeader />
|
|
|
|
|
<LayoutContent>
|
2024-09-16 09:13:06 +00:00
|
|
|
<Outlet />
|
2024-09-02 15:44:49 +00:00
|
|
|
</LayoutContent>
|
|
|
|
|
</Layout>
|
|
|
|
|
</QuotesProvider>
|
|
|
|
|
</ProtectedRoute>
|
|
|
|
|
);
|
2024-06-29 19:39:25 +00:00
|
|
|
};
|