'use client'

import {useTranslations} from 'next-intl'

import CartItems from '@/components/pages/cart/items'

export default function Cart() {
	const t = useTranslations('cart')

	// const subtotal = items.reduce(
	// 	(total, item) => total + item.price * item.quantity,
	// 	0
	// )
	// const total = subtotal

	return (
		<div className='mt-1'>
			<div className='container'>
				<section className='mx-auto my-8 max-w-[640px] text-brand-violet'>
					<h1 className='text-3xl font-bold'>{t('basket')}</h1>
					<div className='bsdg-brand-violet-200 my-4 grid grid-cols-3 gap-4 border-t-2 border-brand-violet py-4'>
						<div className='bg-brand-violet-100'>Назва</div>
						<div className='bg-brand-violet-100'>Кількість</div>
						<div className='bg-brand-violet-100'>Вартість</div>
					</div>
					<CartItems />
				</section>
			</div>
		</div>
	)
}
