import React from 'react'; import Slot from './Slot'; import Persist from '../stores/Persist'; import { ListModifications, Modified } from './SvgIcons'; import { Modifications } from 'coriolis-data/dist'; import { stopCtxPropagation } from '../utils/UtilityFunctions'; /** * Internal Slot */ export default class InternalSlot extends Slot { /** * Generate the slot contents * @param {Object} m Mounted Module * @param {Function} translate Translate function * @param {Object} formats Localized Formats map * @param {Object} u Localized Units Map * @return {React.Component} Slot contents */ _getSlotDetails(m, translate, formats, u) { if (m) { let classRating = m.class + m.rating; let { drag, drop, ship } = this.props; let { termtip, tooltip } = this.context; let validMods = Modifications.modules[m.grp].modifications || []; let showModuleResistances = Persist.showModuleResistances(); // Modifications tooltip shows blueprint and grade, if available let modTT = translate('modified'); if (m && m.blueprint && m.blueprint.name) { modTT = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade; } let mass = m.getMass() || m.cargo || m.fuel || 0; return