"use client"; ///pages/analogeEingaenge.tsx
import React, { useState } from "react";
import AnalogeEingaengeComponent from "../components/modules/AnalogeEingaengeComponent";
import XioPM from "../components/modules/XioPM";
import { analogInputs } from "../data/mockdata/analogInputs";
import { xioPm1Inputs } from "../data/mockdata/xioPm1Inputs";
import { xioPm2Inputs } from "../data/mockdata/xioPm2Inputs";

function AnalogeEingaenge() {
  const [activeConfig, setActiveConfig] = useState<number | null>(null);

  return (
    <div className="flex flex-col h-[calc(100vh-13vh-8vh)] laptop:h-[calc(100vh-10vh-6vh)] xl:h-[calc(100vh-10vh-6vh)] bg-gray-100">
      <div className="flex-grow grid grid-cols-2 gap-1 laptop:gap-2 2xl:p-4 laptop:p-1 overflow-auto">
        <AnalogeEingaengeComponent />

        <div className="border rounded-lg shadow-md p-2 bg-white laptop:p-4">
          <h3 className="text-sm font-semibold mb-1">Diagramm</h3>
          <p>Diagramm wird hier eingefügt</p>
        </div>

        <XioPM
          title="XIO-PM 1"
          data={xioPm1Inputs}
          onConfigClick={(id) => setActiveConfig(id)}
        />

        <XioPM
          title="XIO-PM 2"
          data={xioPm2Inputs}
          onConfigClick={(id) => setActiveConfig(id)}
        />
      </div>
    </div>
  );
}

export default AnalogeEingaenge;
