Files
bodyshop/client/src/components/job-lines-bill-reference/job-lines-bill-reference.component.jsx
2021-01-21 14:20:00 -08:00

30 lines
666 B
JavaScript

import { Spin } from "antd";
import React from "react";
import AlertComponent from "../alert/alert.component";
export default function JobLinesBillRefernece({
jobline,
loading,
error,
billLinesObject,
}) {
if (loading)
return (
<div>
<Spin size="small" className="loading-spinner" />
</div>
);
if (!billLinesObject) return null;
const billLine = billLinesObject[jobline.id];
if (!billLine) return null;
if (error) return <AlertComponent message={error.message} type="error" />;
return (
<div>{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
billLine.bill.vendor.name
})`}</div>
);
}