mirror of
https://github.com/vercel/commerce.git
synced 2025-07-30 05:31:22 +00:00
.github
.vscode
app
components
cart
layout
modules
blurb-section
carousel
filtered-product-list
hero
reusable-section
slider
usp-section
index.ts
usp-section.tsx
product
search
ui
loading-dots.tsx
preview-suspense.tsx
price.tsx
prose.tsx
helpers
lib
messages
public
.env.example
.eslintrc.js
.gitignore
.npmrc
.nvmrc
.prettierignore
README.md
components.json
i18n-config.ts
license.md
middleware.ts
next.config.js
package.json
playwright.config.ts
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
'use client'
|
|
|
|
import SanityImage from '../../ui/sanity-image';
|
|
|
|
interface USPSectionProps {
|
|
usps: [] | any
|
|
}
|
|
|
|
const USPSection = ({ usps }: USPSectionProps) => {
|
|
const desktopGridLayout = usps.length === 4 ? 'lg:grid-cols-4' : 'lg:grid-cols-3';
|
|
|
|
return (
|
|
<div className="px-4 lg:px-8 2xl:px-16">
|
|
<div
|
|
className={`w-full grid grid-cols-2 gap-x-4 gap-y-6 lg:gap-8 2xl:gap-x-16 ${desktopGridLayout}`}
|
|
>
|
|
{usps.map((usp: any, index: number) => (
|
|
<div
|
|
key={index}
|
|
className={`w-full flex flex-col items-center text-center`}
|
|
>
|
|
<div className="w-20 h-20 lg:w-24 lg:h-24">
|
|
<SanityImage
|
|
className="object-cover"
|
|
image={usp?.image}
|
|
alt={usp.name || 'USP image'}
|
|
width={96}
|
|
height={96}
|
|
sizes="96px"
|
|
/>
|
|
</div>
|
|
<h2 className="text-xl mt-4 lg:mt-8 lg:text-2xl">{usp.title}</h2>
|
|
{usp.text && (
|
|
<p className="text-sm mt-2 text-low-contrast max-w-xs lg:text-base lg:mt-4">
|
|
{usp.text}
|
|
</p>
|
|
)}
|
|
</div>
|
|
))}
|
|
</div>
|
|
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default USPSection |