agnets done
This commit is contained in:
@@ -29,8 +29,12 @@ export default function HiringAnalytics({ applications, staff }) {
|
||||
const totalApps = applications.length;
|
||||
const hireRate = totalApps ? Math.round((hiredApps.length / totalApps) * 100) : 0;
|
||||
|
||||
const avgHireScore = hiredApps.length
|
||||
? Math.round(hiredApps.reduce((s, a) => s + (a.ai_score || 0), 0) / hiredApps.length)
|
||||
/* Averaged over the hires that carry a score. A hire can reach 'hired'
|
||||
without ever being scored, and counting that as a 0 drags the figure down
|
||||
by the number of people nobody scored rather than by anything about them. */
|
||||
const scoredHires = hiredApps.filter(a => a.ai_score > 0);
|
||||
const avgHireScore = scoredHires.length
|
||||
? Math.round(scoredHires.reduce((s, a) => s + a.ai_score, 0) / scoredHires.length)
|
||||
: 0;
|
||||
|
||||
const sevenDaysAgo = new Date();
|
||||
@@ -48,7 +52,7 @@ export default function HiringAnalytics({ applications, staff }) {
|
||||
<div className="text-[10px] text-[#9CA3AF] tracking-wide mt-0.5">HIRE RATE</div>
|
||||
</div>
|
||||
<div className="bg-[#F9FAFB] rounded-xl p-3 text-center border border-[#F3F4F6]">
|
||||
<div className="text-2xl font-heading font-bold text-[#333F48]">{avgHireScore}</div>
|
||||
<div className="text-2xl font-heading font-bold text-[#333F48]">{avgHireScore || '—'}</div>
|
||||
<div className="text-[10px] text-[#9CA3AF] tracking-wide mt-0.5">AVG SCORE</div>
|
||||
</div>
|
||||
<div className="bg-[#F9FAFB] rounded-xl p-3 text-center border border-[#F3F4F6]">
|
||||
|
||||
Reference in New Issue
Block a user