import { type PowerData } from "../lib/getPower";
import PowerCard from "./PowerCard";

interface PowerGridProps {
	power: PowerData | null;
}

export default function PowerGrid({ power }: PowerGridProps) {
	const server = power?.devices.find((d) => d.name === "server") ?? null;
	const desktop = power?.devices.find((d) => d.name === "desktop") ?? null;

	return (
		<div className="grid grid-cols-1 md:grid-cols-2 gap-3.5 mb-11">
			<PowerCard device={server} label="Server" delay={0} />
			<PowerCard device={desktop} label="Desktop" delay={60} />
		</div>
	);
}
