import type { ElectricalItem } from '@house-plan-maker/shared';
import { ELECTRICAL_SYMBOL_DEFS } from '../symbols/electrical';

/**
 * Get the coverage radius for a light fixture, if applicable.
 * Returns the radius in meters, or null if not a light type.
 */
export function getLightCoverageRadius(item: ElectricalItem): number | null {
  const def = ELECTRICAL_SYMBOL_DEFS.find(
    (d) => d.type === item.type && d.coverageRadius != null,
  );
  return def?.coverageRadius ?? null;
}
