import React from 'react'; import { observable } from "mobx"; import { observer, inject } from 'mobx-react'; import Attack from './types/Attack'; import Battlegear from './types/Battlegear'; import Creature from './types/Creature'; import Location from './types/Location'; import Mugic from './types/Mugic'; @inject((stores, props, context) => props) @observer export default class CardList extends React.Component { setImage(img) { if (this.props.ext == false) this.props.setImage(img); } render() { let { cards } = this.props; if (cards.length == 1 && cards[0].text) { return (
{cards[0].text}
); } return cards.map((card, i) => { switch (card.gsx$type) { case "Attacks": return (); case "Battlegear": return (); case "Creatures": return (); case "Locations": return (); case "Mugic": return (); default: return (
Invalid Card Type
); } }); } }