Create professional demos and 3D mockups in seconds, directly in your browser
Refactor WallpaperGrid component: replace count-based rendering with static wallpaper array and add a reset option for selection
CristianOlivera15aad7beba553
diff --git a/app/components/ui/wallpaper-grid.tsx b/app/components/ui/wallpaper-grid.tsxindex 85e250b..c0ca9b9 100644--- a/app/components/ui/wallpaper-grid.tsx+++ b/app/components/ui/wallpaper-grid.tsx@@ -6,21 +6,46 @@ interface WallpaperGridProps {count?: number;}-export function WallpaperGrid({ selectedIndex = -1, onSelect, count = 12 }: WallpaperGridProps) {+export const WALLPAPERS = [+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+ "https://avatars.githubusercontent.com/u/171596250?v=4",+];++export function WallpaperGrid({ selectedIndex = -1, onSelect }: WallpaperGridProps) {return (<div className="grid grid-cols-6 gap-2">- {[...Array(count)].map((_, i) => (+ {WALLPAPERS.map((imgSrc, i) => (<divkey={i}onClick={() => onSelect?.(i)}- className={`aspect-square rounded-full cursor-pointer hover:ring-2 ring-white/30 transition ${- selectedIndex === i ? "ring-2 ring-white" : ""+ className={`aspect-square rounded-full cursor-pointer hover:ring-2 ring-white/30 transition bg-cover bg-center ${+ selectedIndex === i ? "ring-2 ring-white shadow-md shadow-black/50" : ""}`}style={{- background: `linear-gradient(${135 + i * 20}deg, #a855f7, #3b82f6)`+ backgroundImage: `url('${imgSrc}')`}}/>))}++ <div+ onClick={() => onSelect?.(-1)}+ className={`aspect-square rounded-full cursor-pointer hover:ring-2 ring-white/30 transition flex items-center justify-center border border-white/20 relative overflow-hidden bg-white ${+ selectedIndex === -1 ? "ring-2 ring-white shadow-lg shadow-black/40" : ""+ }`}+ style={{+ backgroundImage: 'linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%)',+ backgroundSize: '8px 8px',+ backgroundPosition: '0 0, 0 4px, 4px -4px, -4px 0px'+ }}+ >+ <div className="absolute w-[140%] h-0.5 bg-red-500/80 rotate-45 z-10" />+ <div className="absolute inset-0 bg-black/5" />+ </div></div>);-}+}\ No newline at end of file