Ship C3 mobilization events with the actionPlan collection, list/detail/forms UI, upcoming-event blocks, access control, and migration.
56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
import Link from 'next/link'
|
|
|
|
import { cn } from '@/lib/utils'
|
|
import {
|
|
actionPlanDetailTabs,
|
|
buildActionPlanDetailTabHref,
|
|
type ActionPlanDetailSearchParams,
|
|
type ActionPlanDetailTab,
|
|
} from '@/utilities/actionPlanDetailTabUi'
|
|
|
|
const tabLabels: Record<ActionPlanDetailTab, string> = {
|
|
overview: 'Visão geral',
|
|
tasks: 'Tarefas',
|
|
updates: 'Atualizações',
|
|
}
|
|
|
|
export const ActionPlanTabNav = ({
|
|
activeTab,
|
|
planSlug,
|
|
searchParams,
|
|
}: {
|
|
activeTab: ActionPlanDetailTab
|
|
planSlug: string
|
|
searchParams: ActionPlanDetailSearchParams
|
|
}) => (
|
|
<nav
|
|
aria-label="Seções do plano"
|
|
className="h-14 min-w-0 overflow-x-auto overflow-y-hidden border-b"
|
|
>
|
|
<ul
|
|
role="list"
|
|
className="m-0 flex h-full min-w-max list-none items-stretch gap-1 p-0 md:gap-0 lg:gap-1"
|
|
>
|
|
{actionPlanDetailTabs.map((tab) => {
|
|
const isActive = tab === activeTab
|
|
return (
|
|
<li key={tab} className="m-0 h-full p-0">
|
|
<Link
|
|
href={buildActionPlanDetailTabHref(planSlug, tab, searchParams)}
|
|
scroll={false}
|
|
aria-current={isActive ? 'page' : undefined}
|
|
className={cn(
|
|
'relative inline-flex h-full items-center whitespace-nowrap px-4 text-sm font-medium text-muted-foreground outline-none transition-colors md:px-2 lg:px-4',
|
|
'hover:bg-accent hover:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/50',
|
|
'after:absolute after:inset-x-4 after:bottom-0 after:h-0.5 after:bg-transparent',
|
|
isActive && 'font-semibold text-primary after:bg-primary',
|
|
)}
|
|
>
|
|
{tabLabels[tab]}
|
|
</Link>
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
</nav>
|
|
)
|