fix: Update compatible motor identifiers in power supplies data

- Changed compatible motor identifier from "42AIM30" to "42AIM" in power supplies JSON to ensure consistency and accuracy in motor compatibility listings.
This commit is contained in:
MunchDev-oss
2026-01-10 03:53:56 -05:00
parent 0c7504b841
commit ea083485d5
2 changed files with 9 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react';
import { useState, useEffect, useMemo } from 'react';
import partsData from '../../data/index.js';
import { getPriceDisplayFromLinksAsync } from '../../utils/bomUtils';
import { useCurrency } from '../../contexts/CurrencyContext';
@@ -16,10 +16,12 @@ export default function PowerSupplyStep({ config, updateConfig }) {
};
// Filter compatible power supplies
const compatiblePowerSupplies = partsData.powerSupplies.filter((psu) => {
if (!selectedMotorId) return true;
return psu.compatibleMotors.includes(selectedMotorId);
});
const compatiblePowerSupplies = useMemo(() => {
return partsData.powerSupplies.filter((psu) => {
if (!selectedMotorId) return true;
return psu.compatibleMotors.includes(selectedMotorId);
});
}, [selectedMotorId]);
useEffect(() => {
const updatePrices = async () => {

View File

@@ -8,7 +8,7 @@
"image": "/images/power-supplies/24v-PSU.png",
"compatibleMotors": [
"57AIM30",
"42AIM30",
"42AIM",
"iHSV57"
],
"required": true,
@@ -51,7 +51,7 @@
"image": "/images/power-supplies/24v-usbc-pd.png",
"compatibleMotors": [
"57AIM30",
"42AIM30",
"42AIM",
"iHSV57"
],
"required": true,