import React from "react";
import { useTranslation } from "react-i18next";
import CardTemplate from "./job-detail-cards.template.component";
import Car from "../job-damage-visual/job-damage-visual.component";

export default function JobDetailCardsDamageComponent({ loading, data }) {
  const { t } = useTranslation();
  const { area_of_damage } = data;
  return (
    <CardTemplate loading={loading} title={t("jobs.labels.cards.damage")}>
      {area_of_damage ? <Car dmg1={area_of_damage.impact1} dmg2={area_of_damage.impact2} /> : t("jobs.errors.nodamage")}
    </CardTemplate>
  );
}
