15 lines
356 B
TypeScript
15 lines
356 B
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
import { useCart } from './CartProvider';
|
|
|
|
export function CartLink() {
|
|
const { count } = useCart();
|
|
return (
|
|
<Link href="/cart" className="btn-secondary" aria-label={`Cart, ${count} items`}>
|
|
<span aria-hidden>🛒</span>
|
|
<span>Cart{count > 0 ? ` (${count})` : ''}</span>
|
|
</Link>
|
|
);
|
|
}
|