guesstimate/client/src/routes/project/time-preview.tsx

51 lines
2.0 KiB
TypeScript
Raw Normal View History

2020-07-09 13:00:42 +02:00
import React, { FunctionComponent } from "react";
2020-04-20 11:14:46 +02:00
import { Project } from "../../models/project";
import { useProjectEstimations, Estimation } from "../../hooks/use-project-estimations";
import EstimationRange from "../../components/estimation-range";
2020-04-20 11:14:46 +02:00
export interface TimePreviewProps {
project: Project
}
2020-07-09 13:00:42 +02:00
const TimePreview: FunctionComponent<TimePreviewProps> = ({ project }) => {
2020-04-21 14:10:50 +02:00
const estimations = useProjectEstimations(project);
2020-04-20 11:14:46 +02:00
return (
2020-07-09 13:00:42 +02:00
<div className="table-container">
<table className="table is-bordered is-striped is-fullwidth">
2020-04-20 11:14:46 +02:00
<thead>
<tr>
<th colSpan={2}>Prévisionnel temps</th>
</tr>
<tr>
2020-07-09 13:00:42 +02:00
<th className="is-narrow">Confiance</th>
2020-04-20 11:14:46 +02:00
<th>Estimation</th>
</tr>
</thead>
<tbody>
<tr>
2020-07-09 13:00:42 +02:00
<td className="is-narrow">>= 99.7%</td>
<td><EstimationRange project={project} estimation={estimations.p99} /></td>
2020-04-20 11:14:46 +02:00
</tr>
<tr>
2020-07-09 13:00:42 +02:00
<td className="is-narrow">>= 90%</td>
<td><EstimationRange project={project} estimation={estimations.p90} /></td>
2020-04-20 11:14:46 +02:00
</tr>
<tr>
2020-07-09 13:00:42 +02:00
<td className="is-narrow">>= 68%</td>
<td><EstimationRange project={project} estimation={estimations.p68} /></td>
2020-04-20 11:14:46 +02:00
</tr>
</tbody>
2020-07-09 13:00:42 +02:00
<tfoot className="noPrint">
2020-04-20 14:07:26 +02:00
<tr>
<td colSpan={2}>
2020-07-09 13:00:42 +02:00
<a className="is-small is-pulled-right" href="https://en.wikipedia.org/wiki/Three-point_estimation" target="_blank"> Estimation à 3 points</a>
2020-04-20 14:07:26 +02:00
</td>
</tr>
</tfoot>
2020-04-20 11:14:46 +02:00
</table>
</div>
);
};
2020-04-20 11:14:46 +02:00
export default TimePreview;