"use client";
import React, { useState } from "react";
import Register from "./register/Register";
import Search from "./search/Search";
import "./MainForm.css"; // Import CSS for styling

const MainForm: React.FC = () => {
  const [activeTab, setActiveTab] = useState<"register" | "search">("register");

  return (
    <div className="main-container">
      <div className="tabs">
        <button
          className={`tab-button ${activeTab === "register" ? "active" : ""}`}
          onClick={() => setActiveTab("register")}
        >
          Register
        </button>
        <button
          className={`tab-button ${activeTab === "search" ? "active" : ""}`}
          onClick={() => setActiveTab("search")}
        >
          Search
        </button>
      </div>
      <div className="tab-content">
        {activeTab === "register" && <Register />}
        {activeTab === "search" && <Search />}
      </div>
    </div>
  );
};

export default MainForm;
