import React from 'react';
import {Link} from 'react-router';
import ObservationStatus from '../../unit/components/ObservationStatus';
import {getAttr, getUnitIconURL, getServiceName, getObservation} from '../../unit/helpers';

const UnitSuggestion = ({unit, ...rest}) =>
  <Link to={`/unit/${unit.id}`} className="search-suggestions__result" {...rest}>
    <div className="search-suggestions__result-icon">
      <img src={getUnitIconURL(unit)} alt={getServiceName(unit)} />
    </div>
    <div className="search-suggestions__result-details">
      <div className="search-suggestions__result-details__name">{getAttr(unit.name)}</div>
      <ObservationStatus observation={getObservation(unit)}/>
    </div>
  </Link>;

export default UnitSuggestion;

@@ -140,17 +140,8 @@
 rt %7B
-getAttr, 
 getU
@@ -251,16 +251,25 @@
 ...rest%7D
+, context
 ) =%3E%0A  %3C
@@ -602,16 +602,24 @@
 _name%22%3E%7B
+context.
 getAttr(
@@ -721,16 +721,84 @@
 Link%3E;%0A%0A
+UnitSuggestion.contextTypes = %7B%0A  getAttr: React.PropTypes.func%0A%7D;%0A%0A
 export d

Fix translations for unit fields in search suggestions