"use client";

import React from "react";
import Image from "next/image";
import { AuthLayoutProps } from "@/types/auth";
import { cn } from "@/lib/utils";
import Link from "next/link";

export const AuthLayout: React.FC<AuthLayoutProps> = ({
  children,
  showSidebar = true,
  className,
}) => {
  return (
    <div className="flex w-full items-center overflow-hidden min-h-dvh h-dvh basis-full">
      <div className="overflow-y-auto flex flex-wrap w-full h-dvh">
        {showSidebar && (
          <div className="lg:block hidden flex-1 overflow-hidden text-[40px] leading-[48px] text-default-600 relative z-[1] bg-default-50">
            <div className="max-w-[520px] pt-16 ps-20">
              <Link href="/" className="mb-6 inline-block">
                <img
                  src="/Group.png"
                  alt="Mikul News Logo"
                  className="max-w-2xl h-auto drop-shadow-lg"
                />
              </Link>
            </div>
          </div>
        )}
        <div className={cn("flex-1 relative", className)}>
          <div className="h-full flex flex-col dark:bg-default-100 bg-white">
            <div className="max-w-[524px] md:px-[42px] md:py-[44px] p-7 mx-auto w-full text-2xl text-default-900 mb-3 h-full flex flex-col justify-center">
              {children}
            </div>
          </div>
        </div>
      </div>
    </div>
  );
};
