|
|
@ -1,4 +1,5 @@ |
|
|
|
import { cn } from '../../lib/classname'; |
|
|
|
import { cn } from '../../lib/classname'; |
|
|
|
|
|
|
|
import { Blocks, BoxSelect, StickyNote, Text } from 'lucide-react'; |
|
|
|
|
|
|
|
|
|
|
|
export const allowedProjectTabs = ['details', 'solutions'] as const; |
|
|
|
export const allowedProjectTabs = ['details', 'solutions'] as const; |
|
|
|
export type AllowedProjectTab = (typeof allowedProjectTabs)[number]; |
|
|
|
export type AllowedProjectTab = (typeof allowedProjectTabs)[number]; |
|
|
@ -12,8 +13,8 @@ export function ProjectTabs(props: ProjectTabsProps) { |
|
|
|
const { activeTab, projectId } = props; |
|
|
|
const { activeTab, projectId } = props; |
|
|
|
|
|
|
|
|
|
|
|
const tabs = [ |
|
|
|
const tabs = [ |
|
|
|
{ name: 'Project Details', value: 'details' }, |
|
|
|
{ name: 'Project Details', value: 'details', icon: Text }, |
|
|
|
{ name: 'Community Solutions', value: 'solutions' }, |
|
|
|
{ name: 'Community Solutions', value: 'solutions', icon: Blocks }, |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -21,20 +22,20 @@ export function ProjectTabs(props: ProjectTabsProps) { |
|
|
|
{tabs.map((tab) => { |
|
|
|
{tabs.map((tab) => { |
|
|
|
const isActive = tab.value === activeTab; |
|
|
|
const isActive = tab.value === activeTab; |
|
|
|
|
|
|
|
|
|
|
|
const href = |
|
|
|
|
|
|
|
tab.value === 'details' |
|
|
|
|
|
|
|
? `/projects/${projectId}` |
|
|
|
|
|
|
|
: `/projects/${projectId}/${tab.value}`; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<a |
|
|
|
<a |
|
|
|
key={tab.value} |
|
|
|
key={tab.value} |
|
|
|
href={href} |
|
|
|
href={ |
|
|
|
className={cn( |
|
|
|
tab.value === 'details' |
|
|
|
'relative p-2', |
|
|
|
? `/projects/${projectId}` |
|
|
|
isActive ? 'font-medium' : 'opacity-50', |
|
|
|
: `/projects/${projectId}/${tab.value}` |
|
|
|
)} |
|
|
|
} |
|
|
|
|
|
|
|
className={cn('relative flex items-center gap-1 p-2', { |
|
|
|
|
|
|
|
'font-medium text-black': isActive, |
|
|
|
|
|
|
|
'opacity-50 hover:opacity-90': !isActive, |
|
|
|
|
|
|
|
})} |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
{tab.icon && <tab.icon className="mr-1 inline-block h-4 w-4" />} |
|
|
|
{tab.name} |
|
|
|
{tab.name} |
|
|
|
{isActive && ( |
|
|
|
{isActive && ( |
|
|
|
<span className="absolute bottom-0 left-0 right-0 h-0.5 translate-y-1/2 bg-black"></span> |
|
|
|
<span className="absolute bottom-0 left-0 right-0 h-0.5 translate-y-1/2 bg-black"></span> |
|
|
|