"use client";
import {
ArrowUturnDownIcon,
ChevronLeftIcon,
ChevronRightIcon,
QuestionMarkCircleIcon,
} from "@heroicons/react/24/solid";
import { CheckIcon, PlusCircleIcon } from "@heroicons/react/24/outline";
import { motion } from "framer-motion";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { completeOnboarding, createMemory } from "@/app/actions/doers";
import { useRouter } from "next/navigation";
import Logo from "../../../public/logo.svg";
import Image from "next/image";
import { cn } from "@repo/ui/lib/utils";
import gradientStyle from "../signin/_components/TextGradient/gradient.module.css";
export default function Home() {
const [currStep, setCurrStep] = useState(0);
const { push } = useRouter();
useEffect(() => {
const updateDb = async () => {
await completeOnboarding();
};
if (currStep > 3) {
updateDb()
.then(() => {
push("/home?q=what%20is%20supermemory");
})
.catch((e) => {
console.error(e);
});
}
}, [currStep]);
return (
{/* Navbar */}
{/* main-content */}
{currStep === 0 && (
Welcome to{" "}
supermemory
)}
{currStep >= 1 &&
}
{currStep >= 2 &&
}
{currStep >= 3 &&
}
setCurrStep(v)}
currStep={currStep}
/>
);
}
function StepOne({ currStep }: { currStep: number }) {
return (
1 ? (currStep > 2 ? -40 : -20) : 0,
}}
transition={{ duration: 0.2, type: "spring", bounce: 0.1 }}
>
1
? "bg-[#26D987]/10 text-[#26D987]"
: "bg-[#1F2428] text-white"
} `}
>
Import twitter bookmarks
Directly import all your bookmarks from twitter in single click
{getStatusIcon({ completed: currStep > 1 })}
{currStep === 1 && (
-
Download the chrome extension{" "}
here
-
Go to{" "}
x.com
{" "}
and click on the bookmark icon on the bottom right on the screen
)}
);
}
function StepIndicator({
currStep,
setCurrStep,
}: {
currStep: number;
setCurrStep: (v: number) => void;
}) {
return (
= 2 ? "opacity-100" : "opacity-0"}`}
onClick={() => currStep >= 2 && setCurrStep(currStep - 1)}
/>
Step: {currStep}/3
currStep <= 3 && setCurrStep(currStep + 1)}
/>
{Array.from({ length: 3 }).map((_, i) => (
i + 1 ? "bg-[#26D987]" : "bg-white/10"
} rounded-full overflow-hidden`}
>
{i === currStep - 1 && (
)}
))}
);
}
function StepThree({ currStep }: { currStep: number }) {
const { push } = useRouter();
return (
3
? "bg-[#26D987]/10 text-[#26D987]"
: "bg-[#1F2428] text-white"
} `}
>
{/* info */}
{/* icon */}
{/* custom twitter icon */}
Ask a question
Let's use the true power of supermemory!
{/* status */}
{getStatusIcon({ completed: currStep > 3 })}
{currStep === 3 && (
-
Let's start off by adding some content! We have added
supermemory's link for you (you can write your own thoughts or any
other website if you want!)
-
Once saved, you can ask any questions you have about
supermemory.
-
)}
);
}
function StepTwo({ currStep }: { currStep: number }) {
return (
2 ? -20 : 0 }}
transition={{ duration: 0.2, type: "spring", bounce: 0 }}
>
2
? "bg-[#26D987]/10 text-[#26D987]"
: "bg-[#1F2428] text-white"
} `}
>
{/* info */}
{/* icon */}
{/* custom twitter icon */}
Adding Content into supermemory
one click method to save your time.
{/* status */}
{getStatusIcon({ completed: currStep > 2 })}
{currStep === 2 && (
-
You can either add content from the home or from the extension.
)}
);
}
function Navbar() {
const router = useRouter();
const handleSkip = async () => {
await completeOnboarding();
toast.info("Creating memory...", {
icon: ,
duration: 7500,
});
const cont = await createMemory({
content: "https://supermemory.ai",
spaces: undefined,
});
if (cont.success) {
toast.success("Memory created", {
richColors: true,
});
} else {
toast.error(`Memory creation failed: ${cont.error}`);
}
router.push("/home?q=what%20is%20supermemory");
};
return (
);
}
const getStatusIcon = ({ completed }: { completed: boolean }) => {
if (!completed) {
return (
);
} else {
return ;
}
};