226 lines
18 KiB
TypeScript
226 lines
18 KiB
TypeScript
"use client";
|
|
|
|
import React, { useState } from "react";
|
|
import ThemeSwitcher from "@/components/partials/header/theme-switcher";
|
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu";
|
|
import Link from "next/link";
|
|
import { FiFile, FiImage, FiMusic, FiYoutube } from "react-icons/fi";
|
|
import { usePathname, useRouter } from "next/navigation";
|
|
|
|
const Navbar = () => {
|
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
const router = useRouter();
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<div className="bg-white dark:bg-black shadow-md sticky top-0 z-50">
|
|
<div className="flex items-center justify-between px-4 py-3 md:px-6">
|
|
{/* Logo */}
|
|
<a href="/" className="flex items-center space-x-2">
|
|
<img src="/assets/mediahub-logo.gif" alt="Media Hub Logo" className="w-30 h-20 md:w-60 md:h-24 flex" />
|
|
</a>
|
|
|
|
{/* Mobile Menu Toggle */}
|
|
<button className="text-black size-20 h-10 w-10 md:hidden" onClick={() => setMenuOpen(!menuOpen)}>
|
|
{menuOpen ? (
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
<path fill="#000" d="m13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42Z" />
|
|
</svg>
|
|
) : (
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
|
<path fill="#000" d="M4 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m0 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1m1 5a1 1 0 1 0 0 2h14a1 1 0 1 0 0-2z" />
|
|
</svg>
|
|
)}
|
|
</button>
|
|
|
|
{/* Desktop Navigation */}
|
|
<div className="hidden md:flex items-center space-x-6">
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<a className="bg-white text-black flex flex-row justify-center items-center ml-5 cursor-pointer">
|
|
<svg className="mx-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M20 7.5H5C4.6023 7.5004 4.221 7.65856 3.93978 7.93978C3.65856 8.221 3.5004 8.6023 3.5 9V19.5C3.5004 19.8977 3.65856 20.279 3.93978 20.5602C4.221 20.8414 4.6023 20.9996 5 21H20C20.3977 20.9996 20.779 20.8414 21.0602 20.5602C21.3414 20.279 21.4996 19.8977 21.5 19.5V9C21.4996 8.6023 21.3414 8.221 21.0602 7.93978C20.779 7.65856 20.3977 7.5004 20 7.5ZM10.25 17.25V11.25L15.5 14.25L10.25 17.25ZM5 4.5H20V6H5V4.5ZM6.5 1.5H18.5V3H6.5V1.5Z"
|
|
fill="#000000"
|
|
/>
|
|
</svg>
|
|
Konten
|
|
<svg className="flex items-center justify-center" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
<path fill="currentColor" fill-rule="evenodd" d="m6 7l6 6l6-6l2 2l-8 8l-8-8z" />
|
|
</svg>
|
|
</a>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent align="end" className="p-0 rounded-md overflow-hidden">
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700c flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiYoutube className="mr-2" />
|
|
Audio Visual
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiMusic className="mr-2" />
|
|
Audio
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem onClick={() => router.push(`${pathname}/image/filter`)} className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiImage className="mr-2" />
|
|
Foto
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiFile className="mr-2" />
|
|
Teks
|
|
</span>
|
|
</DropdownMenuItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
<Link href="#" className="text-black font-medium flex flex-row items-center justify-center hover:text-gray-800">
|
|
<span>
|
|
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M19.5 4H18.5V3C18.5 2.4 18.1 2 17.5 2C16.9 2 16.5 2.4 16.5 3V4H8.5V3C8.5 2.4 8.1 2 7.5 2C6.9 2 6.5 2.4 6.5 3V4H5.5C3.8 4 2.5 5.3 2.5 7V8H22.5V7C22.5 5.3 21.2 4 19.5 4ZM2.5 19C2.5 20.7 3.8 22 5.5 22H19.5C21.2 22 22.5 20.7 22.5 19V10H2.5V19ZM17.5 12C18.1 12 18.5 12.4 18.5 13C18.5 13.6 18.1 14 17.5 14C16.9 14 16.5 13.6 16.5 13C16.5 12.4 16.9 12 17.5 12ZM17.5 16C18.1 16 18.5 16.4 18.5 17C18.5 17.6 18.1 18 17.5 18C16.9 18 16.5 17.6 16.5 17C16.5 16.4 16.9 16 17.5 16ZM12.5 12C13.1 12 13.5 12.4 13.5 13C13.5 13.6 13.1 14 12.5 14C11.9 14 11.5 13.6 11.5 13C11.5 12.4 11.9 12 12.5 12ZM12.5 16C13.1 16 13.5 16.4 13.5 17C13.5 17.6 13.1 18 12.5 18C11.9 18 11.5 17.6 11.5 17C11.5 16.4 11.9 16 12.5 16ZM7.5 12C8.1 12 8.5 12.4 8.5 13C8.5 13.6 8.1 14 7.5 14C6.9 14 6.5 13.6 6.5 13C6.5 12.4 6.9 12 7.5 12ZM7.5 16C8.1 16 8.5 16.4 8.5 17C8.5 17.6 8.1 18 7.5 18C6.9 18 6.5 17.6 6.5 17C6.5 16.4 6.9 16 7.5 16Z"
|
|
fill="#000000"
|
|
/>
|
|
</svg>
|
|
</span>
|
|
Jadwal
|
|
</Link>
|
|
<Link href="" className="text-black flex flex-row items-center justify-center font-medium hover:text-gray-800">
|
|
<span>
|
|
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
fill-rule="evenodd"
|
|
clip-rule="evenodd"
|
|
d="M2.5 6C2.5 5.20435 2.81607 4.44129 3.37868 3.87868C3.94129 3.31607 4.70435 3 5.5 3H19.5C20.2956 3 21.0587 3.31607 21.6213 3.87868C22.1839 4.44129 22.5 5.20435 22.5 6V18C22.5 18.7956 22.1839 19.5587 21.6213 20.1213C21.0587 20.6839 20.2956 21 19.5 21H5.5C4.70435 21 3.94129 20.6839 3.37868 20.1213C2.81607 19.5587 2.5 18.7956 2.5 18V6ZM7.5 7C7.23478 7 6.98043 7.10536 6.79289 7.29289C6.60536 7.48043 6.5 7.73478 6.5 8V12C6.5 12.2652 6.60536 12.5196 6.79289 12.7071C6.98043 12.8946 7.23478 13 7.5 13H11.5C11.7652 13 12.0196 12.8946 12.2071 12.7071C12.3946 12.5196 12.5 12.2652 12.5 12V8C12.5 7.73478 12.3946 7.48043 12.2071 7.29289C12.0196 7.10536 11.7652 7 11.5 7H7.5ZM8.5 11V9H10.5V11H8.5ZM15.5 7C15.2348 7 14.9804 7.10536 14.7929 7.29289C14.6054 7.48043 14.5 7.73478 14.5 8C14.5 8.26522 14.6054 8.51957 14.7929 8.70711C14.9804 8.89464 15.2348 9 15.5 9H17.5C17.7652 9 18.0196 8.89464 18.2071 8.70711C18.3946 8.51957 18.5 8.26522 18.5 8C18.5 7.73478 18.3946 7.48043 18.2071 7.29289C18.0196 7.10536 17.7652 7 17.5 7H15.5ZM15.5 11C15.2348 11 14.9804 11.1054 14.7929 11.2929C14.6054 11.4804 14.5 11.7348 14.5 12C14.5 12.2652 14.6054 12.5196 14.7929 12.7071C14.9804 12.8946 15.2348 13 15.5 13H17.5C17.7652 13 18.0196 12.8946 18.2071 12.7071C18.3946 12.5196 18.5 12.2652 18.5 12C18.5 11.7348 18.3946 11.4804 18.2071 11.2929C18.0196 11.1054 17.7652 11 17.5 11H15.5ZM7.5 15C7.23478 15 6.98043 15.1054 6.79289 15.2929C6.60536 15.4804 6.5 15.7348 6.5 16C6.5 16.2652 6.60536 16.5196 6.79289 16.7071C6.98043 16.8946 7.23478 17 7.5 17H17.5C17.7652 17 18.0196 16.8946 18.2071 16.7071C18.3946 16.5196 18.5 16.2652 18.5 16C18.5 15.7348 18.3946 15.4804 18.2071 15.2929C18.0196 15.1054 17.7652 15 17.5 15H7.5Z"
|
|
fill="#000000"
|
|
/>
|
|
</svg>
|
|
</span>
|
|
Indeks
|
|
</Link>
|
|
<Link href="#" className="flex items-center space-x-1 text-red-600">
|
|
<span className="w-2 h-2 bg-red-500 rounded-full"></span>
|
|
<span className="font-medium">Live</span>
|
|
</Link>
|
|
<div className="flex items-center space-x-1 ">
|
|
<a href="https://tvradio.polri.go.id/">
|
|
<img src="/assets/polriTv.png" className="w-full h-auto flex-auto" />
|
|
</a>
|
|
</div>
|
|
<select className="bg-transparent text-black border-none focus:outline-none" defaultValue="Indonesia">
|
|
<option>Indonesia</option>
|
|
<option>English</option>
|
|
</select>
|
|
<ThemeSwitcher />
|
|
<div className="relative">
|
|
<input type="text" placeholder="Pencarian" className="pl-8 pr-4 py-1 border rounded-full text-sm text-gray-600 focus:outline-none" />
|
|
<span className="absolute left-2 top-1/2 transform -translate-y-1/2 text-black">🔍</span>
|
|
</div>
|
|
<div className="flex items-center space-x-2">
|
|
<button className="px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700">Masuk</button>
|
|
<button className="px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-red-600 hover:text-white">Daftar</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Mobile Menu */}
|
|
{menuOpen && (
|
|
<div className="md:hidden absolute bg-gray-700 px-4 py-3 w-full space-y-3 z-50">
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<a className=" text-white flex flex-row items-center cursor-pointer">
|
|
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M20 7.5H5C4.6023 7.5004 4.221 7.65856 3.93978 7.93978C3.65856 8.221 3.5004 8.6023 3.5 9V19.5C3.5004 19.8977 3.65856 20.279 3.93978 20.5602C4.221 20.8414 4.6023 20.9996 5 21H20C20.3977 20.9996 20.779 20.8414 21.0602 20.5602C21.3414 20.279 21.4996 19.8977 21.5 19.5V9C21.4996 8.6023 21.3414 8.221 21.0602 7.93978C20.779 7.65856 20.3977 7.5004 20 7.5ZM10.25 17.25V11.25L15.5 14.25L10.25 17.25ZM5 4.5H20V6H5V4.5ZM6.5 1.5H18.5V3H6.5V1.5Z"
|
|
fill="white"
|
|
/>
|
|
</svg>
|
|
Konten
|
|
<svg className="flex items-center justify-center" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
|
|
<path fill="currentColor" fill-rule="evenodd" d="m6 7l6 6l6-6l2 2l-8 8l-8-8z" />
|
|
</svg>
|
|
</a>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent align="end" className="p-0 rounded-md overflow-hidden">
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700c flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiYoutube className="mr-2" />
|
|
Audio Visual
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiMusic className="mr-2" />
|
|
Audio
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiImage className="mr-2" />
|
|
Foto
|
|
</span>
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem className="flex items-center gap-1.5 p-2 border-b text-default-600 group focus:bg-default focus:text-primary-foreground rounded-none group">
|
|
<span className="text-default-700 flex flex-row justify-center items-center group-hover:text-primary-foreground">
|
|
<FiFile className="mr-2" />
|
|
Teks
|
|
</span>
|
|
</DropdownMenuItem>
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
<Link href="#" className="flex text-white flex-row items-center font-medium hover:text-gray-800">
|
|
<span>
|
|
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M19.5 4H18.5V3C18.5 2.4 18.1 2 17.5 2C16.9 2 16.5 2.4 16.5 3V4H8.5V3C8.5 2.4 8.1 2 7.5 2C6.9 2 6.5 2.4 6.5 3V4H5.5C3.8 4 2.5 5.3 2.5 7V8H22.5V7C22.5 5.3 21.2 4 19.5 4ZM2.5 19C2.5 20.7 3.8 22 5.5 22H19.5C21.2 22 22.5 20.7 22.5 19V10H2.5V19ZM17.5 12C18.1 12 18.5 12.4 18.5 13C18.5 13.6 18.1 14 17.5 14C16.9 14 16.5 13.6 16.5 13C16.5 12.4 16.9 12 17.5 12ZM17.5 16C18.1 16 18.5 16.4 18.5 17C18.5 17.6 18.1 18 17.5 18C16.9 18 16.5 17.6 16.5 17C16.5 16.4 16.9 16 17.5 16ZM12.5 12C13.1 12 13.5 12.4 13.5 13C13.5 13.6 13.1 14 12.5 14C11.9 14 11.5 13.6 11.5 13C11.5 12.4 11.9 12 12.5 12ZM12.5 16C13.1 16 13.5 16.4 13.5 17C13.5 17.6 13.1 18 12.5 18C11.9 18 11.5 17.6 11.5 17C11.5 16.4 11.9 16 12.5 16ZM7.5 12C8.1 12 8.5 12.4 8.5 13C8.5 13.6 8.1 14 7.5 14C6.9 14 6.5 13.6 6.5 13C6.5 12.4 6.9 12 7.5 12ZM7.5 16C8.1 16 8.5 16.4 8.5 17C8.5 17.6 8.1 18 7.5 18C6.9 18 6.5 17.6 6.5 17C6.5 16.4 6.9 16 7.5 16Z"
|
|
fill="white"
|
|
/>
|
|
</svg>
|
|
</span>
|
|
Jadwal
|
|
</Link>
|
|
<Link href="#" className="flex text-white flex-row items-center font-medium hover:text-gray-800">
|
|
<span>
|
|
<svg className="mr-2" width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
fill-rule="evenodd"
|
|
clip-rule="evenodd"
|
|
d="M2.5 6C2.5 5.20435 2.81607 4.44129 3.37868 3.87868C3.94129 3.31607 4.70435 3 5.5 3H19.5C20.2956 3 21.0587 3.31607 21.6213 3.87868C22.1839 4.44129 22.5 5.20435 22.5 6V18C22.5 18.7956 22.1839 19.5587 21.6213 20.1213C21.0587 20.6839 20.2956 21 19.5 21H5.5C4.70435 21 3.94129 20.6839 3.37868 20.1213C2.81607 19.5587 2.5 18.7956 2.5 18V6ZM7.5 7C7.23478 7 6.98043 7.10536 6.79289 7.29289C6.60536 7.48043 6.5 7.73478 6.5 8V12C6.5 12.2652 6.60536 12.5196 6.79289 12.7071C6.98043 12.8946 7.23478 13 7.5 13H11.5C11.7652 13 12.0196 12.8946 12.2071 12.7071C12.3946 12.5196 12.5 12.2652 12.5 12V8C12.5 7.73478 12.3946 7.48043 12.2071 7.29289C12.0196 7.10536 11.7652 7 11.5 7H7.5ZM8.5 11V9H10.5V11H8.5ZM15.5 7C15.2348 7 14.9804 7.10536 14.7929 7.29289C14.6054 7.48043 14.5 7.73478 14.5 8C14.5 8.26522 14.6054 8.51957 14.7929 8.70711C14.9804 8.89464 15.2348 9 15.5 9H17.5C17.7652 9 18.0196 8.89464 18.2071 8.70711C18.3946 8.51957 18.5 8.26522 18.5 8C18.5 7.73478 18.3946 7.48043 18.2071 7.29289C18.0196 7.10536 17.7652 7 17.5 7H15.5ZM15.5 11C15.2348 11 14.9804 11.1054 14.7929 11.2929C14.6054 11.4804 14.5 11.7348 14.5 12C14.5 12.2652 14.6054 12.5196 14.7929 12.7071C14.9804 12.8946 15.2348 13 15.5 13H17.5C17.7652 13 18.0196 12.8946 18.2071 12.7071C18.3946 12.5196 18.5 12.2652 18.5 12C18.5 11.7348 18.3946 11.4804 18.2071 11.2929C18.0196 11.1054 17.7652 11 17.5 11H15.5ZM7.5 15C7.23478 15 6.98043 15.1054 6.79289 15.2929C6.60536 15.4804 6.5 15.7348 6.5 16C6.5 16.2652 6.60536 16.5196 6.79289 16.7071C6.98043 16.8946 7.23478 17 7.5 17H17.5C17.7652 17 18.0196 16.8946 18.2071 16.7071C18.3946 16.5196 18.5 16.2652 18.5 16C18.5 15.7348 18.3946 15.4804 18.2071 15.2929C18.0196 15.1054 17.7652 15 17.5 15H7.5Z"
|
|
fill="white"
|
|
/>
|
|
</svg>
|
|
</span>
|
|
Indeks
|
|
</Link>
|
|
<div className="flex items-center space-x-1 text-red-600">
|
|
<span className="w-2 h-2 bg-red-500 rounded-full"></span>
|
|
<span className="font-medium">Live</span>
|
|
</div>
|
|
<div className="flex items-center space-x-1 text-yellow-600 font-medium">
|
|
<a href="https://tvradio.polri.go.id/">
|
|
<img src="/assets/polriTv.png" className="w-32 h-11 flex items-center" />
|
|
</a>
|
|
</div>
|
|
<select className="w-full bg-transparent text-black border border-gray-300 py-1 px-2 rounded focus:outline-none" defaultValue="Indonesia">
|
|
<option>Indonesia</option>
|
|
<option>English</option>
|
|
</select>
|
|
<div className="relative">
|
|
<input type="text" placeholder="Pencarian" className="pl-8 pr-4 py-1 border rounded-full text-sm text-gray-600 focus:outline-none w-full" />
|
|
<span className="absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-500">🔍</span>
|
|
</div>
|
|
<div className="flex flex-col space-y-2">
|
|
<button className="w-full px-4 py-1 bg-[#bb3523] text-white font-semibold rounded-md hover:bg-red-700 md:flex">Masuk</button>
|
|
<button className="w-full px-4 py-1 border border-[#bb3523] text-[#bb3523] font-semibold rounded-md hover:bg-[#bb3523] md:flex hover:text-white">Daftar</button>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Navbar;
|