"use client";
import { redirect } from "next/navigation";
import { Suspense } from "react";
import Inner from "./Inner";
import { useSelector } from "react-redux";
export default function Pack() {
  const user = useSelector((state) => state.auth.user);
  if (!user) {
    redirect("/login");
  }

  let mode = user?.user?.settings?.mode;
  if (!mode) {
    mode = "flip";
  }
  let speed = user?.user?.settings?.speed;

  return (
    <>
      <div className="cm-bg main-card">
        <div className="">
          <div className="anm h-screen">
            <Suspense fallback={null}>
              <Inner user_id={user.userId} mode={mode} />
            </Suspense>
          </div>
        </div>
      </div>
    </>
  );
}
