import React from 'react' import { generateTransform, unitsDimension } from 'app/views/tile/tile.utils' export default function TileScript({ tile, box, bounds, videoBounds, viewing, onMouseDown, onDoubleClick, onMouseEnter }) { // console.log(tile) const style = { transform: generateTransform(tile, box, bounds, videoBounds), opacity: tile.settings.opacity, } // console.log(generateTransform(tile)) let className = ['tile', tile.type].join(' ') if (tile.target_page_id || (viewing && tile.href)) { if (viewing || tile.settings.cursor !== 'unclickable') { className += ' ' + (tile.settings.cursor || 'hand_up') } } if (!tile.settings.content) { return null } let content = className += ' ' + tile.settings.align style.width = unitsDimension(tile, 'width', bounds, videoBounds) style.height = unitsDimension(tile, 'height', bounds, videoBounds) style.fontFamily = tile.settings.font_family style.fontSize = tile.settings.font_size + 'px' style.lineHeight = 1.5 style.fontWeight = (tile.settings.font_style || "").indexOf('bold') !== -1 ? 'bold' : 'normal' style.fontStyle = (tile.settings.font_style || "").indexOf('italic') !== -1 ? 'italic' : 'normal' style.backgroundColor = tile.settings.background_color || 'transparent' style.color = tile.settings.font_color || '#dddddd!important' return (
{content}
) }