text: import { createElement } from '../helpers/domHelper';
  
  export function createFighterPreview(fighter, position) {
    const positionClassName = position === 'right' ? 'fighter-preview___right' : 'fighter-preview___left';
    const fighterElement = createElement({
      tagName: 'div',
      className: `fighter-preview___root ${positionClassName}`,
    });
    fighterElement.innerHTML = `
    <div>${fighter.name}</div>
    <img src = ${fighter.source}>
    <div>attack: ${fighter.attack}</div>
    <div>defense: ${fighter.defense}</div>
    <div>health: ${fighter.health}</div> 
    `
  
  
    // fighterElement.innerHTML = e
    // todo: show fighter info (image, name, health, etc.)
  
    return fighterElement;
  }
  
  export function createFighterImage(fighter) {
    const { source, name } = fighter;
    const attributes = {
      src: source,
      title: name,
      alt: name
    };
    const imgElement = createElement({
      tagName: 'img',
      className: 'fighter-preview___img',
      attributes,
    });
  
    return imgElement;
  }
  