// /components/main/settingsPageComponents/DatabaseSettings.tsx
"use client";
import React from "react";
import handleClearDatabase from "./handlers/dbHandlers/handleClearDatabase";
import handleClearConfig from "./handlers/dbHandlers/handleClearConfig";
import handleClearMessages from "./handlers/dbHandlers/handleClearMessages";
import handleClearLogger from "./handlers/dbHandlers/handleClearLogger";

const DatabaseSettings: React.FC = () => {
  return (
    <div className="p-6 md:p-3 bg-gray-100 max-w-5xl mr-auto">
      <h2 className="text-sm md:text-md font-bold mb-4">
        Datenbank Einstellungen
      </h2>

      <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
        <button
          type="button"
          onClick={handleClearDatabase}
          className="bg-littwin-blue text-white px-3 py-1 rounded text-xs"
        >
          Datenbank vollständig leeren
        </button>

        <button
          type="button"
          onClick={handleClearConfig}
          className="bg-littwin-blue text-white px-3 py-1 rounded text-xs"
        >
          Konfiguration löschen
        </button>

        <button
          type="button"
          onClick={handleClearMessages}
          className="bg-littwin-blue text-white px-3 py-1 rounded text-xs"
        >
          Meldungen löschen
        </button>

        <button
          type="button"
          onClick={handleClearLogger}
          className="bg-littwin-blue text-white px-3 py-1 rounded text-xs"
        >
          Messwerte Logger löschen
        </button>
      </div>
    </div>
  );
};

export default DatabaseSettings;
