Reformat all project files to use the prettier config file.

This commit is contained in:
Patrick Fic
2024-03-27 15:35:07 -07:00
parent b161530381
commit e1df64d592
873 changed files with 111387 additions and 125473 deletions

View File

@@ -1,55 +1,51 @@
import {Card, Divider, Statistic} from "antd";
import { Card, Divider, Statistic } from "antd";
import dayjs from "../../utils/day";
import React from "react";
import {connect} from "react-redux";
import {createStructuredSelector} from "reselect";
import {selectBodyshop} from "../../redux/user/user.selectors";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
bodyshop: selectBodyshop
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export function ScoreboardDayStats({bodyshop, date, entries}) {
const {dailyPaintTarget, dailyBodyTarget} = bodyshop.scoreboard_target;
export function ScoreboardDayStats({ bodyshop, date, entries }) {
const { dailyPaintTarget, dailyBodyTarget } = bodyshop.scoreboard_target;
//let totalHrs = 0;
const paintHrs = entries.reduce((acc, value) => {
// totalHrs = +value.painthrs;
return acc + value.painthrs;
}, 0);
//let totalHrs = 0;
const paintHrs = entries.reduce((acc, value) => {
// totalHrs = +value.painthrs;
return acc + value.painthrs;
}, 0);
const bodyHrs = entries.reduce((acc, value) => {
//totalHrs = +value.bodyhrs;
return acc + value.bodyhrs;
}, 0);
const bodyHrs = entries.reduce((acc, value) => {
//totalHrs = +value.bodyhrs;
return acc + value.bodyhrs;
}, 0);
const numJobs = entries.length;
const numJobs = entries.length;
return (
<Card
title={dayjs(date).format("D - ddd")}
className="ant-card-grid-hoverable"
style={{height: "100%"}}
>
<Statistic
valueStyle={{color: dailyBodyTarget > bodyHrs ? "red" : "green"}}
label="Body"
value={bodyHrs.toFixed(1)}
/>
<Statistic
valueStyle={{color: dailyPaintTarget > paintHrs ? "red" : "green"}}
label="Refinish"
value={paintHrs.toFixed(1)}
/>
<Divider style={{margin: 0}}/>
<Statistic label="Total" value={(bodyHrs + paintHrs).toFixed(1)}/>
<Divider style={{ margin: 0 }} />
<Statistic label="Jobs" value={numJobs} />
</Card>
);
return (
<Card title={dayjs(date).format("D - ddd")} className="ant-card-grid-hoverable" style={{ height: "100%" }}>
<Statistic
valueStyle={{ color: dailyBodyTarget > bodyHrs ? "red" : "green" }}
label="Body"
value={bodyHrs.toFixed(1)}
/>
<Statistic
valueStyle={{ color: dailyPaintTarget > paintHrs ? "red" : "green" }}
label="Refinish"
value={paintHrs.toFixed(1)}
/>
<Divider style={{ margin: 0 }} />
<Statistic label="Total" value={(bodyHrs + paintHrs).toFixed(1)} />
<Divider style={{ margin: 0 }} />
<Statistic label="Jobs" value={numJobs} />
</Card>
);
}
export default connect(mapStateToProps, mapDispatchToProps)(ScoreboardDayStats);