added tons of features

This commit is contained in:
2025-02-05 08:01:14 +02:00
parent 4ae0d8c545
commit 8138da6b1d
195 changed files with 12619 additions and 415 deletions

View File

@@ -0,0 +1,26 @@
import can, {CanAccessResponse} from '@/actions/permission'
import LoginForm from '@/components/auth/forms/login-form'
import CabinetIndex from '@/components/cabinet'
import {Access} from '@/lib/permission'
export default async function CabinetPage({
params
}: {
params: Promise<{slug?: string[]}>
}) {
const user = (await can(Access.Cabinet)) as CanAccessResponse
if (!user.can || !user.session) {
return (
<div className='my-8'>
<div className='container flex flex-col sm:flex-row'>
<LoginForm />
</div>
</div>
)
} else {
const {slug} = await params
return <CabinetIndex slug={slug} session={user.session} />
}
}

View File

@@ -0,0 +1,12 @@
import {Metadata} from 'next'
export const metadata: Metadata = {
title: 'Checkout'
}
export default function CheckoutPage() {
//throw new Error('NOT IMPLEMENTED')
//const session = await auth()
return <div>CheckoutPage</div>
}

View File

@@ -0,0 +1,17 @@
import {ReactNode} from 'react'
import Above from '@/components/shared/above'
import Footer from '@/components/shared/footer'
import Header from '@/components/shared/header'
export default async function HomeLayout({children}: {children: ReactNode}) {
return (
<>
<Above />
<Header />
{/*<Above />*/}
{children}
<Footer />
</>
)
}

View File

@@ -0,0 +1,69 @@
import Image from 'next/image'
import FeatureCards from '@/components/shared/home/feature-cards'
import {HomeCarousel} from '@/components/shared/home/home-carousel'
import AppCatalog from '@/components/shared/sidebar/app-catalog'
import {carousels} from '@/lib/data'
import {db} from '@/lib/db/prisma/client'
import {dump} from '@/lib/utils'
import image from '@/public/uploads/products/IMG_6572.jpg'
// const storeModel = async (id: any) => {
// return db.store.findFirst({
// where: {id},
// include: {
// storeLocale: {
// include: {
// meta: {
// include: {
// openGraph: true
// }
// }
// }
// }
// }
// })
// }
export default async function HomePage() {
return (
<>
<div className='mt-1'>
<div className='container flex flex-col sm:flex-row'>
<section className='bw-layout-col-left pt-3'>
<AppCatalog />
</section>
<div className='bw-layout-col-right pt-3'>
{/*<pre>{dump(await storeModel(1))}</pre>*/}
<section className='w-full'>
<HomeCarousel items={carousels}></HomeCarousel>
</section>
</div>
</div>
</div>
{/*<pre>{JSON.stringify(session)}</pre>*/}
<section className='relative mx-auto mt-8 h-[640px] w-[840px] bg-brand-violet-200'>
<Image
src={'/uploads/products/IMG_6572.jpg'}
//fill
//sizes='(min-width: 808px) 50vw, 100vw'
width={1280}
height={1280}
alt=''
title=''
priority
style={{
objectFit: 'contain' // cover, contain, none
}}
/>
</section>
<section className='mb-4 mt-[128px]'>
<div className='container'>
<FeatureCards />
</div>
</section>
</>
)
}