cms.c2sgmbh/src/components/admin/CommunityNavLinks.tsx
Martin Porwoll 84685778c3 refactor(admin-nav): unify sidebar nav groups to match Payload native style
Replace custom BEM classes and SCSS with Payload's native nav-group CSS
classes for Community and YouTube dashboard nav links. Removes emojis,
adds collapsible toggle with chevron, matches the native sidebar UX.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:25:57 +00:00

48 lines
1.4 KiB
TypeScript

'use client'
import React, { useState } from 'react'
import Link from 'next/link'
export const CommunityNavLinks: React.FC = () => {
const [open, setOpen] = useState(true)
const links = [
{ href: '/admin/views/community/inbox', label: 'Community Inbox' },
{ href: '/admin/views/community/analytics', label: 'Community Analytics' },
]
return (
<div className="nav-group">
<button
className={`nav-group__toggle ${open ? 'nav-group__toggle--open' : ''}`}
type="button"
onClick={() => setOpen(!open)}
>
<div className="nav-group__label">Community Dashboards</div>
<div className="nav-group__indicator">
<svg
className="icon icon--chevron nav-group__indicator"
height="100%"
style={{ transform: open ? 'rotate(180deg)' : 'rotate(0deg)' }}
viewBox="0 0 20 20"
width="100%"
xmlns="http://www.w3.org/2000/svg"
>
<path className="stroke" d="M14 8L10 12L6 8" strokeLinecap="square" />
</svg>
</div>
</button>
{open && (
<div className="nav-group__content">
{links.map((link) => (
<Link key={link.href} href={link.href} className="nav__link">
<span className="nav__link-label">{link.label}</span>
</Link>
))}
</div>
)}
</div>
)
}
export default CommunityNavLinks