mirror of
https://github.com/calli-eve/eve-pi.git
synced 2026-02-15 04:08:48 +01:00
add a setting to alert if extraction is under desired level
This commit is contained in:
@@ -8,7 +8,7 @@ import { PlanetCalculations } from "@/types/planet";
|
||||
import React, { useContext } from "react";
|
||||
import { DateTime } from "luxon";
|
||||
import Countdown from "react-countdown";
|
||||
import { ColorContext } from "@/app/context/Context";
|
||||
import { ColorContext, SessionContext } from "@/app/context/Context";
|
||||
import { ExtractionSimulationTooltip } from "./ExtractionSimulationTooltip";
|
||||
import { timeColor } from "./alerts";
|
||||
|
||||
@@ -40,6 +40,7 @@ export const PlanetCard = ({
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const { colors } = useContext(ColorContext);
|
||||
const { minExtractionRate } = useContext(SessionContext);
|
||||
|
||||
const extractorConfigs: ExtractorConfig[] = planetDetails.extractors
|
||||
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
|
||||
@@ -51,6 +52,8 @@ export const PlanetCard = ({
|
||||
expiryTime: e.expiry_time ?? ""
|
||||
}));
|
||||
|
||||
const hasLowExtractionRate = planetDetails.extractorAverages.length > 0 && minExtractionRate > 0 && planetDetails.extractorAverages.some(avg => avg.averagePerHour < minExtractionRate);
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={
|
||||
@@ -114,9 +117,30 @@ export const PlanetCard = ({
|
||||
/>
|
||||
)}
|
||||
<div style={{ position: "absolute", top: 5, left: 10 }}>
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color={(planetDetails.hasLargeExtractorDifference || hasLowExtractionRate) ? 'error' : 'inherit'}
|
||||
>
|
||||
{planet.infoUniverse?.name}
|
||||
</Typography>
|
||||
{planetDetails.hasLargeExtractorDifference && (
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color="error"
|
||||
sx={{ opacity: 0.7 }}
|
||||
>
|
||||
off-balance
|
||||
</Typography>
|
||||
)}
|
||||
{hasLowExtractionRate && (
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color="error"
|
||||
sx={{ opacity: 0.7 }}
|
||||
>
|
||||
low-extraction
|
||||
</Typography>
|
||||
)}
|
||||
{planetDetails.extractors.map((e, idx) => {
|
||||
const average = planetDetails.extractorAverages[idx];
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user