Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
import { Fragment } from "react";
|
||||
import { Colors } from "~/application/enums/shared/Colors";
|
||||
import SimpleBadge from "~/components/ui/badges/SimpleBadge";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function SpeedBadge({ duration }: { duration: number }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// Lightning fast: Green (e.g. #4CAF50), <10 ms
|
||||
// Fast: Light green (e.g. #8BC34A), 11 - 100 ms
|
||||
// Average: Yellow (e.g. #FFC107), 101 - 500 ms
|
||||
// Slow: Orange (e.g. #FF9800), 501 - 1000 ms
|
||||
// Very slow: Red (e.g. #F44336), >1000 ms
|
||||
return (
|
||||
<Fragment>
|
||||
{duration < 10 && <SimpleBadge title={t("metrics.speed.lightningFast")} color={Colors.GREEN} />}
|
||||
{duration >= 10 && duration < 100 && <SimpleBadge title={t("metrics.speed.fast")} color={Colors.TEAL} />}
|
||||
{duration >= 100 && duration < 500 && <SimpleBadge title={t("metrics.speed.average")} color={Colors.YELLOW} />}
|
||||
{duration >= 500 && duration < 1000 && <SimpleBadge title={t("metrics.speed.slow")} color={Colors.ORANGE} />}
|
||||
{duration >= 1000 && <SimpleBadge title={t("metrics.speed.verySlow")} color={Colors.RED} />}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user