2025-06-22 13:07:02 +02:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import Link from "next/link";
|
2025-06-22 14:28:34 +02:00
|
|
|
import Image from "next/image";
|
2025-06-22 13:07:02 +02:00
|
|
|
import { Button } from "./ui/button";
|
|
|
|
|
import { ArrowRight } from "lucide-react";
|
|
|
|
|
import { HeaderBase } from "./header-base";
|
2025-06-23 22:51:34 +05:30
|
|
|
import { useSession } from "@/lib/auth-client";
|
2025-06-24 01:40:46 +05:30
|
|
|
import { ghStars } from "@/lib/fetchGhStars";
|
|
|
|
|
import { Star } from "lucide-react";
|
2025-06-22 13:07:02 +02:00
|
|
|
|
|
|
|
|
export function Header() {
|
2025-06-24 01:40:46 +05:30
|
|
|
const stars = ghStars();
|
2025-06-23 22:51:34 +05:30
|
|
|
const { data: session } = useSession();
|
2025-06-22 13:07:02 +02:00
|
|
|
const leftContent = (
|
2025-06-22 14:28:34 +02:00
|
|
|
<Link href="/" className="flex items-center gap-3">
|
2025-06-22 22:22:08 +02:00
|
|
|
<Image src="/logo.png" alt="OpenCut Logo" width={24} height={24} />
|
|
|
|
|
<span className="font-medium tracking-tight">OpenCut</span>
|
2025-06-22 13:07:02 +02:00
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const rightContent = (
|
|
|
|
|
<nav className="flex items-center">
|
2025-06-23 00:03:23 +02:00
|
|
|
<Link href="https://github.com/OpenCut-app/OpenCut" target="_blank">
|
2025-06-24 01:40:46 +05:30
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
className="flex items-center text-sm text-muted-foreground hover:text-foreground"
|
|
|
|
|
>
|
|
|
|
|
<span className="hidden sm:inline">GitHub</span>
|
|
|
|
|
<span className="text-foreground flex items-center">
|
|
|
|
|
{stars}+
|
|
|
|
|
<Star className="w-4 h-4 ml-1" />
|
|
|
|
|
</span>
|
2025-06-22 13:07:02 +02:00
|
|
|
</Button>
|
|
|
|
|
</Link>
|
2025-06-23 22:51:34 +05:30
|
|
|
<Link href={session ? "/editor" : "/auth/login"}>
|
2025-06-22 13:07:02 +02:00
|
|
|
<Button size="sm" className="text-sm ml-4">
|
|
|
|
|
Start editing
|
|
|
|
|
<ArrowRight className="h-4 w-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
</nav>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return <HeaderBase leftContent={leftContent} rightContent={rightContent} />;
|
|
|
|
|
}
|