"use client"; import { memo } from "react"; import { cls } from "@/lib/utils"; import type { LucideIcon } from "lucide-react"; import type { InvertedBackground } from "@/providers/themeProvider/config/constants"; export type GridCardItem = { name: string; icon: LucideIcon; }; interface Bento3DCardGridProps { useInvertedBackground: InvertedBackground; items: [GridCardItem, GridCardItem, GridCardItem, GridCardItem]; centerIcon: LucideIcon; className?: string; } const gridItemStyle = { perspective: '1000px', transformStyle: 'preserve-3d' as const, }; const EmptyCell = () => (
); const cardTranslateZ = [ 'group-hover:[transform:translateZ(10px)]', 'group-hover:[transform:translateZ(14px)]', 'group-hover:[transform:translateZ(18px)]', 'group-hover:[transform:translateZ(22px)]', ] as const; const CardCell = ({ name, Icon, cardIndex }: { name: string; Icon: LucideIcon; cardIndex: number }) => (

{name}

); const CenterCell = ({ Icon }: { Icon: LucideIcon }) => (
); const Bento3DCardGrid = ({ useInvertedBackground, items, centerIcon: CenterIcon, className = "", }: Bento3DCardGridProps) => { void useInvertedBackground; const gridPositions = [ { type: 'empty' }, { type: 'card', index: 0 }, { type: 'empty' }, { type: 'card', index: 1 }, { type: 'center' }, { type: 'card', index: 2 }, { type: 'empty' }, { type: 'card', index: 3 }, { type: 'empty' }, ] as const; return (
{gridPositions.map((pos, index) => { switch (pos.type) { case 'card': const item = items[pos.index]; return ; case 'center': return ; default: return ; } })}
); }; Bento3DCardGrid.displayName = "Bento3DCardGrid"; export default memo(Bento3DCardGrid);