|
1
|
import Header from "./header"; |
|
2
|
import Footer from "./footer"; |
|
3
|
import { BottomNav } from "./bottom-nav"; |
|
4
|
import { motion, AnimatePresence } from "framer-motion"; |
|
5
|
import { useLocation } from "wouter"; |
|
6
|
import AIAssistant from "../repair/ai-assistant"; |
|
7
|
|
|
8
|
interface MainLayoutProps { |
|
9
|
children: React.ReactNode; |
|
10
|
} |
|
11
|
|
|
12
|
export default function MainLayout({ children }: MainLayoutProps) { |
|
13
|
const [location] = useLocation(); |
|
14
|
|
|
15
|
return ( |
|
16
|
<div className="min-h-screen bg-background flex flex-col"> |
|
17
|
<Header /> |
|
18
|
|
|
19
|
<main className="flex-1 pb-20 lg:pb-0"> |
|
20
|
<AnimatePresence mode="wait"> |
|
21
|
<motion.div |
|
22
|
key={location} |
|
23
|
initial={{ opacity: 0, y: 10 }} |
|
24
|
animate={{ opacity: 1, y: 0 }} |
|
25
|
exit={{ opacity: 0, y: -10 }} |
|
26
|
transition={{ duration: 0.3, ease: "easeOut" }} |
|
27
|
> |
|
28
|
{children} |
|
29
|
</motion.div> |
|
30
|
</AnimatePresence> |
|
31
|
</main> |
|
32
|
|
|
33
|
<Footer /> |
|
34
|
<BottomNav /> |
|
35
|
<AIAssistant /> |
|
36
|
</div> |
|
37
|
); |
|
38
|
} |