kyd-shared-badge 0.3.55 → 0.3.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -76,7 +76,7 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless }: { badgeData: Pub
|
|
|
76
76
|
const isHeadless = !!headless;
|
|
77
77
|
|
|
78
78
|
// Overall and genre scores
|
|
79
|
-
const overallFinalPercent = assessmentResult?.final_percent || 0;
|
|
79
|
+
const overallFinalPercent = Math.round(assessmentResult?.final_percent || 0);
|
|
80
80
|
|
|
81
81
|
// Build category display grouped by genres from scoring_summary.config.genre_mapping
|
|
82
82
|
const genreMapping = (scoringSummary?.config?.genre_mapping) || {};
|
|
@@ -10,9 +10,9 @@ import { FiInfo, FiAlertTriangle } from 'react-icons/fi';
|
|
|
10
10
|
countriesLib.registerLocale(enLocale);
|
|
11
11
|
|
|
12
12
|
export const getBadgeImageUrl = (score: number, bland: boolean = false) => {
|
|
13
|
-
if (score >= 75) return bland ? '
|
|
14
|
-
if (score >= 50) return bland ? '
|
|
15
|
-
return bland ? '
|
|
13
|
+
if (score >= 75) return bland ? 'badgegreensimple.png' : '/badgegreen2.png';
|
|
14
|
+
if (score >= 50) return bland ? 'badgeyellowsimple.png' : '/badgeyellow2.png';
|
|
15
|
+
return bland ? 'badgeredsimple.png' : '/badgered2.png';
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const hexToRgba = (hex: string, alpha: number) => {
|
package/src/types.ts
CHANGED
|
@@ -476,4 +476,12 @@ export type Role = {
|
|
|
476
476
|
createdAt?: string;
|
|
477
477
|
userId?: string;
|
|
478
478
|
}
|
|
479
|
+
|
|
480
|
+
// Timeseries for dashboard trends
|
|
481
|
+
export type TimeseriesPoint = { date: string; value: number };
|
|
482
|
+
export interface AssessmentTimeseries {
|
|
483
|
+
final_percent: TimeseriesPoint[];
|
|
484
|
+
genres: Record<string, TimeseriesPoint[]>;
|
|
485
|
+
categories: Record<string, TimeseriesPoint[]>;
|
|
486
|
+
}
|
|
479
487
|
|