"use client";
import React, { useRef } from "react";
// Types
import type { NavbarProps } from "./types";
// Images
import { DesignWhizLogo } from "../svg/svg";
// Imports
import clsx from "clsx";
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
import NavbarLinks from "./navbar-links";
import { NavbarCTA } from "./navbar-components";
import { ScrollTrigger } from "gsap/all";
gsap.registerPlugin(useGSAP, ScrollTrigger);
const Navbar: React.FC<NavbarProps> = ({ className }) => {
const navbarRef = useRef<HTMLDivElement>(null);
useGSAP(() => {
ScrollTrigger.create({
trigger: "#navbar-trigger",
start: "top top",
animation: gsap.to(navbarRef.current, {
width: "auto",
}),
toggleActions: "play none reverse none",
});
});
return (
<header
ref={navbarRef}
// ... remaining code is irrelevant, hopefully 😊