import React from 'react'; import Icon from './Icon'; /** * SceneTabs — полоска табов над viewport (синий wow-стиль Рублокса). * * Один статичный таб «🎬 Сцена» (всегда первый, не закрывается) + * динамические табы открытых скриптов. Активный таб подсвечен. * * Props: * tabs — массив { id: 'scene' | scriptId, kind: 'scene' | 'script', title } * activeId — id активного таба * onSelect(id) * onClose(id) — для табов скриптов */ const SceneTabs = ({ tabs = [], activeId, onSelect, onClose }) => { return (
{tabs.map(t => { const active = t.id === activeId; return (
onSelect?.(t.id)} style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '8px 14px 10px', background: active ? '#2e2e2e' : 'transparent', color: active ? '#6d8aff' : '#9a9a9e', borderTopLeftRadius: 12, borderTopRightRadius: 12, border: '1px solid', borderColor: active ? '#3a3a3a' : 'transparent', borderBottomColor: active ? '#2e2e2e' : 'transparent', marginBottom: -1, cursor: 'pointer', fontSize: 13, fontWeight: active ? 800 : 600, letterSpacing: 0.1, transition: 'all 200ms ease', position: 'relative', top: active ? 0 : 1, boxShadow: active ? '0 -2px 6px rgba(0, 0, 0, 0.3)' : 'none', }} title={t.title} onMouseEnter={(e) => { if (!active) { e.currentTarget.style.background = '#2e2e2e'; e.currentTarget.style.color = '#e8e8ea'; } }} onMouseLeave={(e) => { if (!active) { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = '#9a9a9e'; } }} > {/* Маленькая активная полоска сверху таба */} {active && (
)} {t.kind === 'scene' ? : } {t.title} {t.kind === 'script' && ( )}
); })}
); }; export default SceneTabs;