header + navigation and menu

This commit is contained in:
hamid zarghami
2025-08-03 15:53:06 +03:30
parent 61a934074c
commit 76500fb337
46 changed files with 1042 additions and 154 deletions
+38
View File
@@ -0,0 +1,38 @@
import Header from '@/share/Header'
import { FC, ComponentType } from 'react'
// import Header from '@/share/Header'
interface LayoutProps {
children: React.ReactNode
}
const Layout: FC<LayoutProps> = ({ children }) => {
return (
<div className="min-h-screen flex flex-col">
<Header />
<main className="flex-1">
{children}
</main>
{/* <Footer /> */}
</div>
)
}
// HOC function
function withLayout<P extends object>(WrappedComponent: ComponentType<P>) {
const WithLayoutComponent: FC<P> = (props) => {
return (
<Layout>
<WrappedComponent {...props} />
</Layout>
)
}
WithLayoutComponent.displayName = `withLayout(${WrappedComponent.displayName || WrappedComponent.name})`
return WithLayoutComponent
}
export default withLayout
export { Layout }