Fix model list
This commit is contained in:
@@ -5,7 +5,7 @@ import * as THREE from 'three';
|
||||
import JSZip from 'jszip';
|
||||
import { AppConfig, GeneratedPart, LayoutSplits } from '../types';
|
||||
import { createBinGeometry, generateSTL, exportSTL } from '../services/geometryGenerator';
|
||||
import { Download, Package, Info, Loader2, Share2, Check, Ruler, MousePointer2 } from 'lucide-react';
|
||||
import { Download, Package, Info, Loader2, Share2, Check, Ruler } from 'lucide-react';
|
||||
import { generateShareUrl } from '../utils/share';
|
||||
|
||||
// --- DrawerFrame (Каркас) ---
|
||||
@@ -247,14 +247,13 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-y-auto pr-1 custom-scrollbar">
|
||||
{/* --- GRID LAYOUT --- */}
|
||||
<div className="grid grid-cols-2 gap-3 pb-4">
|
||||
{parts.map(part => (
|
||||
<div
|
||||
key={part.id}
|
||||
ref={(el) => { itemRefs.current[part.id] = el }}
|
||||
className={`
|
||||
p-3 rounded-lg border transition-all cursor-pointer group flex flex-col gap-3 relative overflow-hidden
|
||||
p-3 rounded-lg border transition-all cursor-pointer group flex flex-col gap-2 relative overflow-hidden
|
||||
${selectedId === part.id
|
||||
? 'bg-slate-800 border-accent shadow-md shadow-accent/10 ring-1 ring-accent'
|
||||
: 'bg-slate-800/50 border-slate-700 hover:border-slate-500 hover:bg-slate-800'
|
||||
@@ -262,12 +261,13 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
`}
|
||||
onClick={() => setSelectedId(part.id)}
|
||||
>
|
||||
{/* Цветной индикатор на фоне */}
|
||||
{/* Фон-индикатор */}
|
||||
<div
|
||||
className="absolute top-0 right-0 w-16 h-16 bg-gradient-to-br from-white/5 to-transparent rounded-bl-3xl pointer-events-none"
|
||||
style={{ backgroundColor: part.color, opacity: 0.1 }}
|
||||
/>
|
||||
|
||||
{/* Заголовок */}
|
||||
<div className="flex items-center justify-between z-10">
|
||||
<span className="font-bold text-gray-200 text-xs truncate" title={part.name}>
|
||||
{part.name}
|
||||
@@ -277,10 +277,16 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
style={{ backgroundColor: part.color }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* --- РАЗМЕРЫ (НОВОЕ) --- */}
|
||||
<div className="text-[10px] text-gray-400 font-mono z-10">
|
||||
{part.width.toFixed(0)} × {part.depth.toFixed(0)} × {part.height.toFixed(0)}
|
||||
</div>
|
||||
|
||||
{/* Кнопка */}
|
||||
<button
|
||||
onClick={(e) => { e.stopPropagation(); handleDownload(part); }}
|
||||
className="w-full py-1.5 bg-slate-700 hover:bg-primary hover:text-white text-gray-300 rounded text-xs flex items-center justify-center gap-1.5 transition-colors font-medium border border-slate-600 hover:border-primary"
|
||||
className="w-full py-1.5 bg-slate-700 hover:bg-primary hover:text-white text-gray-300 rounded text-xs flex items-center justify-center gap-1.5 transition-colors font-medium border border-slate-600 hover:border-primary z-10 mt-1"
|
||||
>
|
||||
<Download size={12} /> STL
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user