feat: scaffold complete danable frontend architecture with all pages, layouts, stores, and 3 annotator modes
This commit is contained in:
commit
78848dd7d1
173 changed files with 18649 additions and 0 deletions
63
src/layouts/components/Sidebar/RecentProjects.tsx
Normal file
63
src/layouts/components/Sidebar/RecentProjects.tsx
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
import React from 'react'
|
||||
import { Link, useLocation } from 'react-router-dom'
|
||||
import clsx from 'clsx'
|
||||
|
||||
interface RecentProjectItem {
|
||||
id: string
|
||||
name: string
|
||||
path: string
|
||||
dotColor: string
|
||||
}
|
||||
|
||||
const RECENT_PROJECTS: RecentProjectItem[] = [
|
||||
{
|
||||
id: 'proj-1',
|
||||
name: 'Phương tiện đô thị',
|
||||
path: '/projects/proj-1',
|
||||
dotColor: 'bg-indigo-500',
|
||||
},
|
||||
{
|
||||
id: 'proj-2',
|
||||
name: 'Giao thông đô thị',
|
||||
path: '/projects/proj-2',
|
||||
dotColor: 'bg-blue-600',
|
||||
},
|
||||
{
|
||||
id: 'proj-3',
|
||||
name: 'Phân vùng đường phố',
|
||||
path: '/projects/proj-3',
|
||||
dotColor: 'bg-violet-500',
|
||||
},
|
||||
]
|
||||
|
||||
export const RecentProjects: React.FC = () => {
|
||||
const location = useLocation()
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="px-2 mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-500">
|
||||
DỰ ÁN GẦN ĐÂY
|
||||
</div>
|
||||
<div className="space-y-0.5">
|
||||
{RECENT_PROJECTS.map((project) => {
|
||||
const isCurrent = location.pathname.startsWith(project.path)
|
||||
return (
|
||||
<Link
|
||||
key={project.id}
|
||||
to={project.path}
|
||||
className={clsx(
|
||||
'flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-xs font-medium transition-colors',
|
||||
isCurrent
|
||||
? 'bg-slate-100 text-slate-900 font-semibold'
|
||||
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
|
||||
)}
|
||||
>
|
||||
<span className={clsx('h-1.5 w-1.5 rounded-full shrink-0', project.dotColor)} />
|
||||
<span className="truncate">{project.name}</span>
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue