feat: publish danable frontend updates
4
.env
|
|
@ -1,4 +0,0 @@
|
||||||
VITE_API_URL=http://localhost:8000/api/v1
|
|
||||||
VITE_APP_NAME=danable
|
|
||||||
VITE_USE_MOCK_DATA=true
|
|
||||||
|
|
||||||
11
.gitignore
vendored
|
|
@ -5,3 +5,14 @@ dist-ssr
|
||||||
.env.local
|
.env.local
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
# Local environment files (VITE_* values are public, but keep local config out of Git)
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# TypeScript incremental build cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
design-figma
|
||||||
|
img-plan
|
||||||
|
docs
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<title>danable · Nền tảng dữ liệu cho AI</title>
|
<title>danable · Nền tảng dữ liệu cho AI</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-slate-50 text-slate-900 antialiased selection:bg-brand-500 selection:text-white">
|
<body class="bg-slate-50 text-slate-900 antialiased selection:bg-brand-500 selection:text-white">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
3
public/assets/arrow-right.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M3.33301 7.99999H12.6674M8.00021 12.6672L12.6674 7.99999L8.00021 3.33279" stroke-width="1.7" stroke-linecap="round" stroke="white"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 245 B |
10
public/assets/building-2.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_13_13958)">
|
||||||
|
<path d="M6.66677 8H9.33365M6.66677 5.33333H9.33365M9.33365 14V12C9.33365 11.6464 9.19316 11.3072 8.94309 11.0572C8.69302 10.8071 8.35386 10.6667 8.00021 10.6667C7.64656 10.6667 7.30739 10.8071 7.05732 11.0572C6.80726 11.3072 6.66677 11.6464 6.66677 12V14M9.33365 14H6.66677M9.33365 14H12.0005M6.66677 14H3.99989M3.99989 6.66667H2.66645C2.3128 6.66667 1.97363 6.80714 1.72356 7.05719C1.47349 7.30724 1.33301 7.64638 1.33301 8V12.6667C1.33301 13.0203 1.47349 13.3594 1.72356 13.6095C1.97363 13.8595 2.3128 14 2.66645 14H3.99989M3.99989 6.66667V14M3.99989 6.66667V3.33333C3.99989 2.97971 4.14037 2.64057 4.39044 2.39052C4.64051 2.14048 4.97968 2 5.33333 2H10.6671C11.0207 2 11.3599 2.14048 11.61 2.39052C11.86 2.64057 12.0005 2.97971 12.0005 3.33333V4.66667M12.0005 14H13.334C13.6876 14 14.0268 13.8595 14.2769 13.6095C14.5269 13.3594 14.6674 13.0203 14.6674 12.6667V6C14.6674 5.64638 14.5269 5.30724 14.2769 5.05719C14.0268 4.80714 13.6876 4.66667 13.334 4.66667H12.0005M12.0005 14V4.66667" stroke-width="1.7" stroke-linecap="round" stroke="#697386"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_13_13958">
|
||||||
|
<rect width="16" height="16" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.3 KiB |
10
public/assets/eye-off.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_13_13967)">
|
||||||
|
<path d="M7.15584 3.38395C8.70874 3.19887 10.2795 3.52717 11.6284 4.31872C12.9772 5.11027 14.0299 6.32156 14.6257 7.76763C14.6813 7.91732 14.6813 8.08198 14.6257 8.23167C14.3807 8.82571 14.057 9.3841 13.6631 9.8918M9.38964 9.43879C9.01244 9.80313 8.50724 10.0047 7.98285 10.0002C7.45847 9.99562 6.95685 9.78527 6.58604 9.41442C6.21523 9.04358 6.00489 8.54191 6.00034 8.01747C5.99578 7.49304 6.19736 6.98779 6.56168 6.61056M11.6525 11.6661C10.7682 12.19 9.78153 12.5176 8.75948 12.6265C7.73743 12.7354 6.7039 12.6232 5.72904 12.2975C4.75417 11.9717 3.86077 11.4401 3.10946 10.7386C2.35815 10.0371 1.76651 9.18219 1.37468 8.23187C1.31912 8.08218 1.31912 7.91752 1.37468 7.76784C1.96576 6.33429 3.00577 5.13112 4.33864 4.33889M1.33366 1.33279L14.6668 14.6672" stroke-width="1.7" stroke-linecap="round" stroke="#697386"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_13_13967">
|
||||||
|
<rect width="16" height="16" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1 KiB |
3
public/assets/lock-keyhole.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M4.66667 6.66655V4.66639C4.66667 3.78227 5.01786 2.93435 5.64298 2.30918C6.2681 1.68401 7.11595 1.33279 8 1.33279C8.88406 1.33279 9.7319 1.68401 10.357 2.30918C10.9821 2.93435 11.3333 3.78227 11.3333 4.66639V6.66655M4.66667 6.66655H3.33333C2.59695 6.66655 2 7.26356 2 7.99999V13.3338C2 14.0702 2.59695 14.6672 3.33333 14.6672H12.6667C13.403 14.6672 14 14.0702 14 13.3338V7.99999C14 7.26356 13.403 6.66655 12.6667 6.66655H11.3333M4.66667 6.66655H11.3333M8.66667 10.6669C8.66667 11.0351 8.36819 11.3336 8 11.3336C7.63181 11.3336 7.33333 11.0351 7.33333 10.6669C7.33333 10.2987 7.63181 10.0002 8 10.0002C8.36819 10.0002 8.66667 10.2987 8.66667 10.6669Z" stroke-width="1.7" stroke-linecap="round" stroke="#697386"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 824 B |
3
public/assets/mail.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M14.6674 4.667L8.67293 8.48462C8.46951 8.60275 8.23845 8.66497 8.00321 8.66497C7.76797 8.66497 7.53691 8.60275 7.33349 8.48462L1.33301 4.667M14.6674 4.667V4.0004C14.6674 3.26409 14.0704 2.6672 13.334 2.6672H2.66645C1.93001 2.6672 1.33301 3.26409 1.33301 4.0004V4.667M14.6674 4.667V11.9996C14.6674 12.7359 14.0704 13.3328 13.334 13.3328H2.66645C1.93001 13.3328 1.33301 12.7359 1.33301 11.9996V4.667" stroke-width="1.7" stroke-linecap="round" stroke="#697386"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 572 B |
BIN
public/assets/nh-giao-th-ng.jpg
Normal file
|
After Width: | Height: | Size: 287 KiB |
3
public/assets/shield-check.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M4.87505 6.49973L5.95828 7.5831L8.12473 5.41636M10.8328 7.04166C10.8328 9.75008 8.93715 11.1043 6.68404 11.8897C6.56606 11.9297 6.4379 11.9278 6.32116 11.8843C4.06264 11.1043 2.16699 9.75008 2.16699 7.04166V3.24987C2.16699 3.1062 2.22405 2.96842 2.32563 2.86684C2.4272 2.76525 2.56496 2.70818 2.7086 2.70818C3.79183 2.70818 5.14586 2.05816 6.08827 1.2348C6.20301 1.13676 6.34897 1.08289 6.49989 1.08289C6.65081 1.08289 6.79677 1.13676 6.91152 1.2348C7.85934 2.06358 9.20795 2.70818 10.2912 2.70818C10.4348 2.70818 10.5726 2.76525 10.6742 2.86684C10.7757 2.96842 10.8328 3.1062 10.8328 3.24987V7.04166Z" stroke-width="1.7" stroke-linecap="round" stroke="#697386"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 776 B |
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { Component, ErrorInfo, ReactNode } from 'react'
|
import { Component, ErrorInfo, ReactNode } from 'react'
|
||||||
import { Button } from '../ui/Button'
|
import { Button } from '../ui/Button'
|
||||||
|
|
||||||
export interface ErrorBoundaryProps {
|
export interface ErrorBoundaryProps {
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,10 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Outlet, Link } from 'react-router-dom'
|
import { Outlet } from 'react-router-dom'
|
||||||
import { showToast } from '../components/feedback/Toast'
|
|
||||||
|
|
||||||
export const AuthLayout: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
export const AuthLayout: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-[#FAF9F6] flex flex-col justify-between text-slate-900">
|
<div className="min-h-screen w-full bg-white text-[#141c2a]">
|
||||||
{/* Top Bar */}
|
|
||||||
<header className="w-full px-6 sm:px-10 py-5 flex items-center justify-between border-b border-slate-200/60 bg-white/80 backdrop-blur-sm">
|
|
||||||
<Link to="/login" className="flex items-center gap-3">
|
|
||||||
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-[#C95C3C] text-white shadow-sm">
|
|
||||||
<svg
|
|
||||||
className="h-4 w-4"
|
|
||||||
fill="none"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth={2.2}
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
d="M4 8V6a2 2 0 012-2h2M4 16v2a2 2 0 002 2h2m8-16h2a2 2 0 012 2v2m-4 12h2a2 2 0 002-2v-2"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<span className="text-xl font-bold tracking-tight text-slate-900">
|
|
||||||
danable
|
|
||||||
</span>
|
|
||||||
<span className="hidden sm:inline-block rounded-full border border-slate-200 bg-slate-50 px-2.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-slate-500">
|
|
||||||
NỀN TẢNG DỮ LIỆU CHO AI
|
|
||||||
</span>
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<div className="text-xs text-slate-500">
|
|
||||||
Chưa có tài khoản?{' '}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() =>
|
|
||||||
showToast.info('Vui lòng liên hệ admin@danable.vn để được cấp tài khoản')
|
|
||||||
}
|
|
||||||
className="font-semibold text-[#C95C3C] hover:underline"
|
|
||||||
>
|
|
||||||
Liên hệ quản trị viên ↗
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* Main Content */}
|
|
||||||
<main className="flex-1 flex items-center justify-center p-4 sm:p-8">
|
|
||||||
{children || <Outlet />}
|
{children || <Outlet />}
|
||||||
</main>
|
|
||||||
|
|
||||||
{/* Footer */}
|
|
||||||
<footer className="w-full px-6 sm:px-10 py-4 border-t border-slate-200/60 bg-white/60 flex flex-col sm:flex-row items-center justify-between gap-2 text-xs text-slate-400">
|
|
||||||
<div>© 2026 danable · Hệ thống gán nhãn dữ liệu thị giác máy tính</div>
|
|
||||||
<div className="flex items-center gap-4">
|
|
||||||
<span className="inline-flex items-center gap-1.5 text-slate-500">
|
|
||||||
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500" />
|
|
||||||
Máy chủ ổn định (v2.4.0)
|
|
||||||
</span>
|
|
||||||
<span>Bảo mật</span>
|
|
||||||
<span>Điều khoản</span>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,16 @@ export const DashboardLayout: React.FC<{ children?: React.ReactNode }> = ({
|
||||||
children,
|
children,
|
||||||
}) => {
|
}) => {
|
||||||
const { pathname } = useLocation()
|
const { pathname } = useLocation()
|
||||||
const isProjectList = pathname === '/projects'
|
const isProjectWorkspaceScreen =
|
||||||
|
pathname === '/projects' || /^\/projects\/[^/]+$/.test(pathname)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex text-slate-900 ${isProjectList ? 'h-screen min-h-0 overflow-hidden bg-[var(--project-canvas)]' : 'min-h-screen bg-[#F8FAFC]'}`}>
|
<div className={`flex text-slate-900 ${isProjectWorkspaceScreen ? 'h-screen min-h-0 overflow-hidden bg-[var(--project-canvas)]' : 'min-h-screen bg-[#F8FAFC]'}`}>
|
||||||
<Sidebar isProjectList={isProjectList} />
|
<Sidebar isProjectWorkspace={isProjectWorkspaceScreen} />
|
||||||
<div className="flex-1 flex flex-col min-w-0">
|
<div className="flex-1 flex flex-col min-w-0">
|
||||||
<Header isProjectList={isProjectList} />
|
<Header isProjectWorkspace={isProjectWorkspaceScreen} />
|
||||||
<main className={`flex-1 overflow-y-auto ${isProjectList ? 'project-list-main h-[calc(100vh-64px)] min-h-0 p-6' : 'p-6 lg:p-8'}`}>
|
<main className={`flex-1 overflow-y-auto ${isProjectWorkspaceScreen ? 'project-workspace-main h-[calc(100vh-64px)] min-h-0 p-6' : 'p-6 lg:p-8'}`}>
|
||||||
<div className={isProjectList ? 'w-full' : 'mx-auto max-w-7xl'}>{children || <Outlet />}</div>
|
<div className={isProjectWorkspaceScreen ? 'w-full' : 'mx-auto max-w-7xl'}>{children || <Outlet />}</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@ import { UserMenu } from './UserMenu'
|
||||||
|
|
||||||
export interface HeaderProps {
|
export interface HeaderProps {
|
||||||
breadcrumbItems?: BreadcrumbItem[]
|
breadcrumbItems?: BreadcrumbItem[]
|
||||||
isProjectList?: boolean
|
isProjectWorkspace?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Header: React.FC<HeaderProps> = ({ breadcrumbItems, isProjectList = false }) => {
|
export const Header: React.FC<HeaderProps> = ({ breadcrumbItems, isProjectWorkspace = false }) => {
|
||||||
return (
|
return (
|
||||||
<header className={`shrink-0 bg-white px-6 flex items-center justify-between sticky top-0 z-20 ${isProjectList ? 'h-16 shadow-[inset_0_-1px_0_0_var(--project-border)]' : 'h-14 border-b border-slate-200/80'}`}>
|
<header className={`shrink-0 bg-white px-6 flex items-center justify-between sticky top-0 z-20 ${isProjectWorkspace ? 'h-16 shadow-[inset_0_-1px_0_0_var(--project-border)]' : 'h-14 border-b border-slate-200/80'}`}>
|
||||||
<Breadcrumb items={breadcrumbItems} />
|
<Breadcrumb items={breadcrumbItems} />
|
||||||
<div className={`flex items-center ${isProjectList ? 'gap-5' : 'gap-4'}`}>
|
<div className={`flex items-center ${isProjectWorkspace ? 'gap-5' : 'gap-4'}`}>
|
||||||
<SystemStatus isProjectList={isProjectList} />
|
<SystemStatus isProjectWorkspace={isProjectWorkspace} />
|
||||||
<NotificationBell isProjectList={isProjectList} />
|
<NotificationBell isProjectWorkspace={isProjectWorkspace} />
|
||||||
<UserMenu isProjectList={isProjectList} />
|
<UserMenu isProjectWorkspace={isProjectWorkspace} />
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const MOCK_NOTIFICATIONS: NotificationItem[] = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export const NotificationBell: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const NotificationBell: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const [notifications, setNotifications] = useState(MOCK_NOTIFICATIONS)
|
const [notifications, setNotifications] = useState(MOCK_NOTIFICATIONS)
|
||||||
const ref = useRef<HTMLDivElement>(null)
|
const ref = useRef<HTMLDivElement>(null)
|
||||||
|
|
@ -54,10 +54,10 @@ export const NotificationBell: React.FC<{ isProjectList?: boolean }> = ({ isProj
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
onClick={() => setOpen((prev) => !prev)}
|
||||||
className={`relative rounded-full transition-colors ${isProjectList ? 'p-0 text-[#697386]' : 'p-2 text-slate-500 hover:bg-slate-100 hover:text-slate-800'}`}
|
className={`relative rounded-full transition-colors ${isProjectWorkspace ? 'p-0 text-[#697386]' : 'p-2 text-slate-500 hover:bg-slate-100 hover:text-slate-800'}`}
|
||||||
aria-label="Thông báo"
|
aria-label="Thông báo"
|
||||||
>
|
>
|
||||||
{isProjectList ? <img className="h-[18px] w-[18px]" src="/assets/projects-ui/bell.svg" alt="" /> : <svg
|
{isProjectWorkspace ? <img className="h-[18px] w-[18px]" src="/assets/projects-ui/bell.svg" alt="" /> : <svg
|
||||||
className="h-4 w-4"
|
className="h-4 w-4"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
|
|
@ -70,7 +70,7 @@ export const NotificationBell: React.FC<{ isProjectList?: boolean }> = ({ isProj
|
||||||
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
|
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
|
||||||
/>
|
/>
|
||||||
</svg>}
|
</svg>}
|
||||||
{!isProjectList && unreadCount > 0 && (
|
{!isProjectWorkspace && unreadCount > 0 && (
|
||||||
<span className="absolute top-1.5 right-1.5 h-2 w-2 rounded-full bg-[#C95C3C] ring-2 ring-white" />
|
<span className="absolute top-1.5 right-1.5 h-2 w-2 rounded-full bg-[#C95C3C] ring-2 ring-white" />
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const SystemStatus: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const SystemStatus: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
return (
|
return (
|
||||||
<div className={`hidden items-center text-slate-600 sm:flex ${isProjectList ? 'gap-2 text-[10px] text-[#697386]' : 'gap-2 text-xs'}`}>
|
<div className={`hidden items-center text-slate-600 sm:flex ${isProjectWorkspace ? 'gap-2 text-[10px] text-[#697386]' : 'gap-2 text-xs'}`}>
|
||||||
<span className={`rounded-full bg-[#168262] ${isProjectList ? 'h-1.5 w-1.5' : 'h-2 w-2 bg-emerald-600'}`} />
|
<span className={`rounded-full bg-[#168262] ${isProjectWorkspace ? 'h-1.5 w-1.5' : 'h-2 w-2 bg-emerald-600'}`} />
|
||||||
<span>Hệ thống ổn định</span>
|
<span>Hệ thống ổn định</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ import { useNavigate } from 'react-router-dom'
|
||||||
import { Dropdown } from '../../../components/ui/Dropdown'
|
import { Dropdown } from '../../../components/ui/Dropdown'
|
||||||
import { showToast } from '../../../components/feedback/Toast'
|
import { showToast } from '../../../components/feedback/Toast'
|
||||||
|
|
||||||
export const UserMenu: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const UserMenu: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
align="right"
|
align="right"
|
||||||
trigger={
|
trigger={
|
||||||
<div className={`flex h-[30px] w-[30px] items-center justify-center rounded-full text-[11px] font-semibold text-[#5451d6] transition-all ${isProjectList ? 'bg-[#f5ded6]' : 'bg-orange-100 text-slate-800 hover:ring-2 hover:ring-orange-200'}`}>
|
<div className={`flex h-[30px] w-[30px] items-center justify-center rounded-full text-[11px] font-semibold text-[var(--project-accent)] transition-all ${isProjectWorkspace ? 'bg-[var(--project-avatar-background)]' : 'bg-orange-100 text-slate-800 hover:ring-2 hover:ring-orange-200'}`}>
|
||||||
MA
|
MA
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Link, useLocation } from 'react-router-dom'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { getProjects, subscribeProjectsStore } from '@/pages/projects/projectData'
|
import { getProjects, subscribeProjectsStore } from '@/pages/projects/projectData'
|
||||||
|
|
||||||
export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const RecentProjects: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const [recentProjects, setRecentProjects] = useState(() => getProjects().slice(0, 3))
|
const [recentProjects, setRecentProjects] = useState(() => getProjects().slice(0, 3))
|
||||||
|
|
||||||
|
|
@ -11,13 +11,12 @@ export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjec
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectList ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectWorkspace ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
||||||
DỰ ÁN GẦN ĐÂY
|
DỰ ÁN GẦN ĐÂY
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-0.5">
|
<div className="space-y-0.5">
|
||||||
{recentProjects.map((project) => {
|
{recentProjects.map((project) => {
|
||||||
const projectPath = `/projects/${project.id}`
|
const projectPath = `/projects/${project.id}`
|
||||||
const dotColors = ['bg-[#a29fff]', 'bg-[#a29fff]', 'bg-[#a29fff]']
|
|
||||||
const isCurrent = location.pathname.startsWith(projectPath)
|
const isCurrent = location.pathname.startsWith(projectPath)
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
|
|
@ -25,15 +24,17 @@ export const RecentProjects: React.FC<{ isProjectList?: boolean }> = ({ isProjec
|
||||||
to={projectPath}
|
to={projectPath}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'flex items-center transition-colors',
|
'flex items-center transition-colors',
|
||||||
isProjectList
|
isProjectWorkspace
|
||||||
? 'gap-2 px-2.5 py-0.5 text-[11px] font-normal leading-[17px] text-[#332926]'
|
? 'gap-2 px-2.5 py-0.5 text-[11px] font-normal leading-[17px] text-[var(--project-heading)]'
|
||||||
: 'gap-2.5 rounded-lg px-2.5 py-2 text-xs font-medium',
|
: 'gap-2.5 rounded-lg px-2.5 py-2 text-xs font-medium',
|
||||||
isCurrent
|
isProjectWorkspace
|
||||||
|
? 'text-[var(--project-heading)]'
|
||||||
|
: isCurrent
|
||||||
? 'bg-slate-100 text-slate-900 font-semibold'
|
? 'bg-slate-100 text-slate-900 font-semibold'
|
||||||
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
|
: 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<span className={`h-[5px] w-[5px] shrink-0 rounded-full ${isProjectList ? 'bg-[#a29fff]' : 'bg-indigo-500'}`} />
|
<span className={`h-[5px] w-[5px] shrink-0 rounded-full ${isProjectWorkspace ? 'bg-[var(--project-accent-dot)]' : 'bg-indigo-500'}`} />
|
||||||
<span className="truncate">{project.name}</span>
|
<span className="truncate">{project.name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,13 @@ import { RecentProjects } from './RecentProjects'
|
||||||
import { StorageUsage } from './StorageUsage'
|
import { StorageUsage } from './StorageUsage'
|
||||||
import { UserInfo } from './UserInfo'
|
import { UserInfo } from './UserInfo'
|
||||||
|
|
||||||
export const Sidebar: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const Sidebar: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
return (
|
return (
|
||||||
<aside className={`shrink-0 bg-white flex flex-col justify-between h-screen sticky top-0 select-none ${isProjectList ? 'w-[216px] px-4 pt-7 pb-5' : 'w-[240px] border-r border-slate-200/80 px-3.5 py-4'}`}>
|
<aside className={`shrink-0 bg-white flex flex-col justify-between h-screen sticky top-0 select-none ${isProjectWorkspace ? 'w-[216px] px-4 pt-7 pb-5' : 'w-[240px] border-r border-slate-200/80 px-3.5 py-4'}`}>
|
||||||
<div className={isProjectList ? 'space-y-7' : 'space-y-5'}>
|
<div className={isProjectWorkspace ? 'space-y-7' : 'space-y-5'}>
|
||||||
{/* Brand Logo */}
|
{/* Brand Logo */}
|
||||||
<Link to="/projects" className="flex items-center gap-2.5 px-1">
|
<Link to="/projects" className="flex items-center gap-2.5 px-1">
|
||||||
{isProjectList ? (
|
{isProjectWorkspace ? (
|
||||||
<img className="h-8 w-8 shrink-0" src="/assets/bi-u-tr-ng.svg" alt="" />
|
<img className="h-8 w-8 shrink-0" src="/assets/bi-u-tr-ng.svg" alt="" />
|
||||||
) : (
|
) : (
|
||||||
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-[#C95C3C] text-white shadow-sm">
|
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-[#C95C3C] text-white shadow-sm">
|
||||||
|
|
@ -25,24 +25,24 @@ export const Sidebar: React.FC<{ isProjectList?: boolean }> = ({ isProjectList =
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<span className={isProjectList ? 'text-[25px] font-bold tracking-[-1px] text-[#332926]' : 'text-xl font-bold tracking-tight text-slate-900'}>
|
<span className={isProjectWorkspace ? 'text-[25px] font-bold tracking-[-1px] text-[#332926]' : 'text-xl font-bold tracking-tight text-slate-900'}>
|
||||||
danable
|
danable
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{/* Workspace Selector */}
|
{/* Workspace Selector */}
|
||||||
<WorkspaceSelector isProjectList={isProjectList} />
|
<WorkspaceSelector isProjectWorkspace={isProjectWorkspace} />
|
||||||
|
|
||||||
{/* Navigation Links */}
|
{/* Navigation Links */}
|
||||||
<SidebarNav isProjectList={isProjectList} />
|
<SidebarNav isProjectWorkspace={isProjectWorkspace} />
|
||||||
|
|
||||||
{/* Recent Projects */}
|
{/* Recent Projects */}
|
||||||
<RecentProjects isProjectList={isProjectList} />
|
<RecentProjects isProjectWorkspace={isProjectWorkspace} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={isProjectList ? 'space-y-2.5' : 'space-y-4 pt-4'}>
|
<div className={isProjectWorkspace ? 'space-y-2.5' : 'space-y-4 pt-4'}>
|
||||||
<StorageUsage isProjectList={isProjectList} />
|
<StorageUsage isProjectWorkspace={isProjectWorkspace} />
|
||||||
<UserInfo isProjectList={isProjectList} />
|
<UserInfo isProjectWorkspace={isProjectWorkspace} />
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ interface NavItem {
|
||||||
matchPrefix: string
|
matchPrefix: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SidebarNav: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const SidebarNav: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
|
||||||
const navItems: NavItem[] = [
|
const navItems: NavItem[] = [
|
||||||
|
|
@ -32,7 +32,7 @@ export const SidebarNav: React.FC<{ isProjectList?: boolean }> = ({ isProjectLis
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectList ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
<div className={`px-2 mb-2 text-[9px] font-semibold text-slate-500 ${isProjectWorkspace ? 'tracking-normal text-[#332926]' : 'uppercase tracking-wider'}`}>
|
||||||
KHÔNG GIAN LÀM VIỆC
|
KHÔNG GIAN LÀM VIỆC
|
||||||
</div>
|
</div>
|
||||||
<nav className="space-y-1">
|
<nav className="space-y-1">
|
||||||
|
|
@ -47,9 +47,9 @@ export const SidebarNav: React.FC<{ isProjectList?: boolean }> = ({ isProjectLis
|
||||||
key={item.to}
|
key={item.to}
|
||||||
to={item.to}
|
to={item.to}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
`flex items-center justify-between transition-colors ${isProjectList ? 'h-[42px] rounded-[7px] px-3 text-[13px]' : 'rounded-xl px-3 py-2.5 text-sm'} font-medium`,
|
`flex items-center justify-between transition-colors ${isProjectWorkspace ? 'h-[42px] rounded-[7px] px-3 text-[13px]' : 'rounded-xl px-3 py-2.5 text-sm'} font-medium`,
|
||||||
isActive
|
isActive
|
||||||
? (isProjectList ? 'bg-[#c75c4a] text-white' : 'bg-[#C95C3C] text-white shadow-sm')
|
? (isProjectWorkspace ? 'bg-[var(--brand-primary)] text-white' : 'bg-[#C95C3C] text-white shadow-sm')
|
||||||
: 'text-slate-700 hover:bg-slate-100'
|
: 'text-slate-700 hover:bg-slate-100'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const StorageUsage: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const StorageUsage: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
return (
|
return (
|
||||||
<div className={`rounded-[8px] p-3 ${isProjectList ? 'bg-[#f1f3fe]' : 'rounded-xl border border-slate-200/60 bg-slate-100/80 p-3.5'}`}>
|
<div className={`rounded-[8px] p-3 ${isProjectWorkspace ? 'bg-[#f1f3fe]' : 'rounded-xl border border-slate-200/60 bg-slate-100/80 p-3.5'}`}>
|
||||||
<div className={`mb-2 flex items-center justify-between font-medium text-slate-700 ${isProjectList ? 'text-[10px] text-[#332926]' : 'text-xs'}`}>
|
<div className={`mb-2 flex items-center justify-between font-medium text-slate-700 ${isProjectWorkspace ? 'text-[10px] text-[#332926]' : 'text-xs'}`}>
|
||||||
<span>Dung lượng dữ liệu</span>
|
<span>Dung lượng dữ liệu</span>
|
||||||
<span className="font-semibold text-slate-900">24%</span>
|
<span className="font-semibold text-slate-900">24%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-1 w-full overflow-hidden rounded-full bg-[#e5e8ed]">
|
<div className="h-1 w-full overflow-hidden rounded-full bg-[#e5e8ed]">
|
||||||
<div
|
<div
|
||||||
className={`h-full rounded-full ${isProjectList ? 'bg-[#8a87f4]' : 'bg-[#3B5BDB]'}`}
|
className={`h-full rounded-full ${isProjectWorkspace ? 'bg-[#8a87f4]' : 'bg-[#3B5BDB]'}`}
|
||||||
style={{ width: '24%' }}
|
style={{ width: '24%' }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={`mt-2 text-slate-500 ${isProjectList ? 'text-[9px] text-[#332926]' : 'text-[11px]'}`}>
|
<div className={`mt-2 text-slate-500 ${isProjectWorkspace ? 'text-[9px] text-[#332926]' : 'text-[11px]'}`}>
|
||||||
12 GB / 50 GB đã sử dụng
|
12 GB / 50 GB đã sử dụng
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
import { showToast } from '../../../components/feedback/Toast'
|
import { showToast } from '../../../components/feedback/Toast'
|
||||||
|
|
||||||
export const UserInfo: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const UserInfo: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
|
|
@ -15,10 +15,10 @@ export const UserInfo: React.FC<{ isProjectList?: boolean }> = ({ isProjectList
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => showToast.info('Tài liệu hướng dẫn sử dụng danable v1.0')}
|
onClick={() => showToast.info('Tài liệu hướng dẫn sử dụng danable v1.0')}
|
||||||
className={`flex w-full items-center gap-2 text-xs font-medium text-slate-600 transition-colors hover:text-slate-900 ${isProjectList ? 'px-2.5 py-2 text-[11px]' : 'px-2 py-1.5'}`}
|
className={`flex w-full items-center gap-2 text-xs font-medium text-slate-600 transition-colors hover:text-slate-900 ${isProjectWorkspace ? 'px-2.5 py-2 text-[11px]' : 'px-2 py-1.5'}`}
|
||||||
>
|
>
|
||||||
{isProjectList ? <img className="h-4 w-4" src="/assets/projects-ui/circle-help.svg" alt="" /> : <svg
|
{isProjectWorkspace ? <img className="h-4 w-4" src="/assets/projects-ui/circle-help.svg" alt="" /> : <svg
|
||||||
className={`h-4 w-4 ${isProjectList ? 'text-[#697386]' : 'text-slate-400'}`}
|
className={`h-4 w-4 ${isProjectWorkspace ? 'text-[#697386]' : 'text-slate-400'}`}
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
@ -33,21 +33,21 @@ export const UserInfo: React.FC<{ isProjectList?: boolean }> = ({ isProjectList
|
||||||
<span>Tài liệu & hỗ trợ</span>
|
<span>Tài liệu & hỗ trợ</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div className={`flex items-center justify-between ${isProjectList ? 'border-t border-[#2d374d] pt-[18px]' : 'border-t border-slate-200 pt-3'}`}>
|
<div className={`flex items-center justify-between ${isProjectWorkspace ? 'border-t border-[#2d374d] pt-[18px]' : 'border-t border-slate-200 pt-3'}`}>
|
||||||
<div className="flex items-center gap-2.5 min-w-0">
|
<div className="flex items-center gap-2.5 min-w-0">
|
||||||
<div className={`flex shrink-0 items-center justify-center rounded-full font-semibold ${isProjectList ? 'h-[34px] w-[34px] bg-[#f5ded6] text-[11px] text-[#332926]' : 'h-8 w-8 bg-orange-100 text-xs text-slate-800'}`}>
|
<div className={`flex shrink-0 items-center justify-center rounded-full font-semibold ${isProjectWorkspace ? 'h-[34px] w-[34px] bg-[#f5ded6] text-[11px] text-[#332926]' : 'h-8 w-8 bg-orange-100 text-xs text-slate-800'}`}>
|
||||||
MA
|
MA
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<div className={`truncate font-semibold ${isProjectList ? 'text-[12px] text-[#332926]' : 'text-xs text-slate-900'}`}>
|
<div className={`truncate font-semibold ${isProjectWorkspace ? 'text-[12px] text-[#332926]' : 'text-xs text-slate-900'}`}>
|
||||||
Minh Anh
|
Minh Anh
|
||||||
</div>
|
</div>
|
||||||
<div className={`truncate ${isProjectList ? 'text-[10px] text-[#332926]' : 'text-[11px] text-slate-500'}`}>
|
<div className={`truncate ${isProjectWorkspace ? 'text-[10px] text-[#332926]' : 'text-[11px] text-slate-500'}`}>
|
||||||
Quản trị viên
|
Quản trị viên
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!isProjectList && <button
|
{!isProjectWorkspace && <button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={handleLogout}
|
onClick={handleLogout}
|
||||||
title="Đăng xuất"
|
title="Đăng xuất"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { showToast } from '../../../components/feedback/Toast'
|
import { showToast } from '../../../components/feedback/Toast'
|
||||||
|
|
||||||
export const WorkspaceSelector: React.FC<{ isProjectList?: boolean }> = ({ isProjectList = false }) => {
|
export const WorkspaceSelector: React.FC<{ isProjectWorkspace?: boolean }> = ({ isProjectWorkspace = false }) => {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -9,22 +9,22 @@ export const WorkspaceSelector: React.FC<{ isProjectList?: boolean }> = ({ isPro
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
onClick={() => setOpen((prev) => !prev)}
|
||||||
className={`w-full flex items-center justify-between bg-white text-left transition-colors ${isProjectList ? 'gap-[9px] rounded-[8px] border border-[#344057] p-2.5 hover:border-[#344057]' : 'rounded-xl border border-slate-300/90 px-3 py-2.5 hover:border-slate-400'}`}
|
className={`w-full flex items-center justify-between bg-white text-left transition-colors ${isProjectWorkspace ? 'gap-[9px] rounded-[8px] border border-[#344057] p-2.5 hover:border-[#344057]' : 'rounded-xl border border-slate-300/90 px-3 py-2.5 hover:border-slate-400'}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2.5 min-w-0">
|
<div className="flex items-center gap-2.5 min-w-0">
|
||||||
<div className={`flex h-8 w-8 shrink-0 items-center justify-center text-[11px] font-semibold text-[#332926] ${isProjectList ? 'h-7 w-7 rounded-[6px] bg-[#d6dae6]' : 'rounded-full bg-indigo-50 text-slate-700'}`}>
|
<div className={`flex h-8 w-8 shrink-0 items-center justify-center text-[11px] font-semibold text-[#332926] ${isProjectWorkspace ? 'h-7 w-7 rounded-[6px] bg-[#d6dae6]' : 'rounded-full bg-indigo-50 text-slate-700'}`}>
|
||||||
VL
|
VL
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<div className={`truncate font-semibold leading-tight ${isProjectList ? 'text-[13px] text-[#332926]' : 'text-sm text-slate-900'}`}>
|
<div className={`truncate font-semibold leading-tight ${isProjectWorkspace ? 'text-[13px] text-[#332926]' : 'text-sm text-slate-900'}`}>
|
||||||
danable
|
danable
|
||||||
</div>
|
</div>
|
||||||
<div className={`truncate mt-0.5 ${isProjectList ? 'text-[10px] text-[#332926]' : 'text-[11px] text-slate-500'}`}>
|
<div className={`truncate mt-0.5 ${isProjectWorkspace ? 'text-[10px] text-[#332926]' : 'text-[11px] text-slate-500'}`}>
|
||||||
Không gian nhóm
|
Không gian nhóm
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isProjectList ? (
|
{isProjectWorkspace ? (
|
||||||
<img className="h-[13px] w-[13px] shrink-0" src="/assets/projects-ui/chevrons-up-down.svg" alt="" />
|
<img className="h-[13px] w-[13px] shrink-0" src="/assets/projects-ui/chevrons-up-down.svg" alt="" />
|
||||||
) : (
|
) : (
|
||||||
<svg className="h-4 w-4 shrink-0 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.8}>
|
<svg className="h-4 w-4 shrink-0 text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.8}>
|
||||||
|
|
|
||||||
|
|
@ -172,23 +172,6 @@ function createTrafficBoulevardSvg(variant = 1): string {
|
||||||
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`
|
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function createTruckStreetSvg(): string {
|
|
||||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080" width="1920" height="1080">
|
|
||||||
<rect width="1920" height="500" fill="#CBD5E1"/>
|
|
||||||
<circle cx="320" cy="260" r="210" fill="#1E4620"/>
|
|
||||||
<circle cx="1520" cy="250" r="220" fill="#2D5A27"/>
|
|
||||||
<rect y="500" width="1920" height="580" fill="#64748B"/>
|
|
||||||
<!-- Blue Cargo Truck -->
|
|
||||||
<rect x="520" y="320" width="540" height="360" rx="12" fill="#1D4ED8" stroke="#1E3A8A" stroke-width="4"/>
|
|
||||||
<rect x="1060" y="410" width="240" height="270" rx="16" fill="#2563EB"/>
|
|
||||||
<rect x="1140" y="435" width="140" height="95" rx="8" fill="#1E293B"/>
|
|
||||||
<circle cx="670" cy="700" r="64" fill="#0F172A"/>
|
|
||||||
<circle cx="960" cy="700" r="64" fill="#0F172A"/>
|
|
||||||
<circle cx="1200" cy="700" r="64" fill="#0F172A"/>
|
|
||||||
</svg>`
|
|
||||||
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`
|
|
||||||
}
|
|
||||||
|
|
||||||
export const DEFAULT_CLASSES: LabelClass[] = [
|
export const DEFAULT_CLASSES: LabelClass[] = [
|
||||||
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 1, shortcutKey: '1' },
|
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 1, shortcutKey: '1' },
|
||||||
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 2, shortcutKey: '2' },
|
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 2, shortcutKey: '2' },
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useRef, useState } from 'react'
|
import React, { useRef, useState } from 'react'
|
||||||
import { AnnotationShape, BoundingBox, Point2D } from '@/types'
|
import { BoundingBox, Point2D } from '@/types'
|
||||||
import { normalizeBBox } from '@/utils/canvas'
|
import { normalizeBBox } from '@/utils/canvas'
|
||||||
import { useAnnotatorStore } from '../../annotatorStore'
|
import { useAnnotatorStore } from '../../annotatorStore'
|
||||||
import { ImageViewer } from './ImageViewer'
|
import { ImageViewer } from './ImageViewer'
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
import { LoginRequest } from '../../types'
|
import { LoginRequest } from '@/types'
|
||||||
|
import { LOGIN_COLORS } from '@/styles/theme'
|
||||||
import { HeroSection } from './components/HeroSection'
|
import { HeroSection } from './components/HeroSection'
|
||||||
import { LoginForm } from './components/LoginForm'
|
import { LoginForm } from './components/LoginForm'
|
||||||
|
|
||||||
|
const FOOTER_LINKS = [
|
||||||
|
'Điều khoản sử dụng',
|
||||||
|
'Chính sách bảo mật',
|
||||||
|
'Tiếng Việt ⌄',
|
||||||
|
]
|
||||||
|
|
||||||
export const LoginPage: React.FC = () => {
|
export const LoginPage: React.FC = () => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
|
|
@ -26,108 +33,81 @@ export const LoginPage: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-white text-slate-900 flex flex-col justify-between">
|
<div
|
||||||
{/* Top Navigation Bar matching wireframe */}
|
className="min-h-screen w-full flex justify-center items-start overflow-x-hidden"
|
||||||
<header className="w-full max-w-[1360px] mx-auto px-6 sm:px-12 pt-7 pb-4 flex items-center justify-between">
|
style={{ backgroundColor: LOGIN_COLORS.bgWhite }}
|
||||||
<div className="flex items-center gap-16">
|
|
||||||
{/* Brand Logo */}
|
|
||||||
<div className="flex items-center gap-2.5">
|
|
||||||
<div className="w-8 h-8 rounded-lg bg-[#C95C3C] flex items-center justify-center text-white shadow-sm">
|
|
||||||
<svg
|
|
||||||
className="w-4 h-4"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2.2"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
>
|
||||||
<path d="M4 8V6a2 2 0 0 1 2-2h2" />
|
{/* Khung thiết kế chuẩn 1440x900 từ Figma (chia 2 cột: 660px trái + 780px phải) */}
|
||||||
<path d="M4 16v2a2 2 0 0 0 2 2h2" />
|
<div
|
||||||
<path d="M16 4h2a2 2 0 0 1 2 2v2" />
|
className="w-full max-w-[1440px] min-h-[900px] flex flex-col lg:flex-row items-start overflow-hidden"
|
||||||
<path d="M16 20h2a2 2 0 0 0 2-2v-2" />
|
style={{ backgroundColor: LOGIN_COLORS.bgWhite }}
|
||||||
</svg>
|
>
|
||||||
</div>
|
{/* Cột trái (660px): Giới thiệu nền tảng & Thẻ minh họa gán nhãn */}
|
||||||
<span className="text-xl font-bold tracking-tight text-slate-900">
|
<HeroSection />
|
||||||
danable
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span className="hidden md:inline-block text-[10px] font-semibold uppercase tracking-[0.14em] text-slate-500">
|
{/* Cột phải (780px): Khu vực Đăng nhập */}
|
||||||
NỀN TẢNG DỮ LIỆU CHO AI
|
<div className="shrink-0 w-full lg:w-[780px] min-h-[900px] flex flex-col justify-between items-center pt-[42px] pr-16 pb-8 pl-16 overflow-hidden">
|
||||||
</span>
|
{/* Liên kết hỗ trợ cấp tài khoản góc trên bên phải */}
|
||||||
</div>
|
<div className="shrink-0 self-stretch flex justify-end items-start gap-1.5 overflow-hidden">
|
||||||
|
<p
|
||||||
<div className="text-xs text-slate-500">
|
className="shrink-0 font-sans text-[12px] font-normal leading-[18px] whitespace-nowrap"
|
||||||
<span>Chưa có tài khoản? </span>
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
|
>
|
||||||
|
Chưa có tài khoản?
|
||||||
|
</p>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setContactModalOpen(true)}
|
onClick={() => setContactModalOpen(true)}
|
||||||
className="font-semibold text-indigo-600 hover:text-indigo-700 inline-flex items-center gap-0.5"
|
className="shrink-0 font-sans text-[12px] font-semibold leading-[18px] whitespace-nowrap hover:underline"
|
||||||
|
style={{ color: LOGIN_COLORS.brandAccentIndigo }}
|
||||||
>
|
>
|
||||||
<span>Liên hệ quản trị viên</span>
|
Liên hệ quản trị viên ↗
|
||||||
<span aria-hidden="true">↗</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* Main 2-Column Content */}
|
{/* Biểu mẫu đăng nhập trung tâm */}
|
||||||
<main className="w-full max-w-[1360px] mx-auto px-6 sm:px-12 py-6 flex-1 flex items-center">
|
|
||||||
<div className="w-full grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-8 items-center">
|
|
||||||
{/* Left Column: HeroSection */}
|
|
||||||
<div className="lg:col-span-6">
|
|
||||||
<HeroSection />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Right Column: LoginForm */}
|
|
||||||
<div className="lg:col-span-6 flex flex-col items-center">
|
|
||||||
<LoginForm
|
<LoginForm
|
||||||
onSubmit={handleLogin}
|
onSubmit={handleLogin}
|
||||||
onSSOLogin={handleSSOLogin}
|
onSSOLogin={handleSSOLogin}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
{/* Bottom Footer Links */}
|
{/* Liên kết điều khoản & ngôn ngữ cuối trang */}
|
||||||
<footer className="w-full max-w-[1360px] mx-auto px-6 sm:px-12 py-6 flex flex-col sm:flex-row items-center justify-end gap-6 text-xs text-slate-500">
|
<div className="shrink-0 flex items-start gap-[22px] overflow-hidden">
|
||||||
<div className="flex items-center gap-6 lg:w-1/2 justify-center">
|
{FOOTER_LINKS.map((item) => (
|
||||||
<a
|
|
||||||
href="#terms"
|
|
||||||
onClick={(e) => e.preventDefault()}
|
|
||||||
className="hover:text-slate-800 transition-colors"
|
|
||||||
>
|
|
||||||
Điều khoản sử dụng
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="#privacy"
|
|
||||||
onClick={(e) => e.preventDefault()}
|
|
||||||
className="hover:text-slate-800 transition-colors"
|
|
||||||
>
|
|
||||||
Chính sách bảo mật
|
|
||||||
</a>
|
|
||||||
<button
|
<button
|
||||||
|
key={item}
|
||||||
type="button"
|
type="button"
|
||||||
className="inline-flex items-center gap-1 hover:text-slate-800 transition-colors"
|
className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap hover:underline"
|
||||||
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
>
|
>
|
||||||
<span>Tiếng Việt</span>
|
{item}
|
||||||
<span className="text-[10px]">∨</span>
|
|
||||||
</button>
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
|
||||||
|
|
||||||
{/* Contact Admin Info Modal */}
|
{/* Hộp thoại thông tin khi bấm "Liên hệ quản trị viên" */}
|
||||||
{contactModalOpen && (
|
{contactModalOpen && (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-[1px] p-4">
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-[1px] p-4">
|
||||||
<div className="bg-white rounded-2xl max-w-md w-full p-6 shadow-xl border border-slate-200">
|
<div className="bg-white rounded-2xl max-w-md w-full p-6 shadow-xl border border-slate-200">
|
||||||
<h3 className="text-lg font-bold text-slate-900 mb-2">
|
<h3
|
||||||
|
className="text-lg font-bold mb-2"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
|
>
|
||||||
Liên hệ quản trị viên không gian nhóm
|
Liên hệ quản trị viên không gian nhóm
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-slate-600 leading-relaxed mb-4">
|
<p
|
||||||
|
className="text-sm leading-relaxed mb-4"
|
||||||
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
|
>
|
||||||
danable hoạt động theo mô hình lời mời nội bộ để đảm bảo an toàn
|
danable hoạt động theo mô hình lời mời nội bộ để đảm bảo an toàn
|
||||||
dữ liệu. Vui lòng liên hệ Quản trị viên nhóm của bạn (ví dụ:{' '}
|
dữ liệu. Vui lòng liên hệ Quản trị viên nhóm của bạn (ví dụ:{' '}
|
||||||
<span className="font-medium text-slate-900">
|
<span
|
||||||
|
className="font-medium"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
|
>
|
||||||
minhanh@visionlab.vn
|
minhanh@visionlab.vn
|
||||||
</span>
|
</span>
|
||||||
) để nhận email lời mời tham gia dự án.
|
) để nhận email lời mời tham gia dự án.
|
||||||
|
|
@ -136,7 +116,8 @@ export const LoginPage: React.FC = () => {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setContactModalOpen(false)}
|
onClick={() => setContactModalOpen(false)}
|
||||||
className="px-4 py-2 rounded-xl bg-[#C95C3C] text-white text-sm font-medium hover:bg-[#B5492B] transition-colors"
|
className="px-4 py-2 rounded-lg text-white text-sm font-medium transition-opacity hover:opacity-95"
|
||||||
|
style={{ backgroundColor: LOGIN_COLORS.brandOrangeRed }}
|
||||||
>
|
>
|
||||||
Đã hiểu
|
Đã hiểu
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,149 +1,196 @@
|
||||||
import React, { useState } from 'react'
|
import React from 'react'
|
||||||
|
import { LOGIN_COLORS, createInsetOutlineStyle } from '@/styles/theme'
|
||||||
|
|
||||||
|
interface BoundingBoxItem {
|
||||||
|
id: string
|
||||||
|
label: string
|
||||||
|
color: string
|
||||||
|
position: {
|
||||||
|
left: number
|
||||||
|
top: number
|
||||||
|
width: number
|
||||||
|
height: number
|
||||||
|
}
|
||||||
|
badgeWidth: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Danh sách các khung nhận diện vật thể (Bounding Box) hiển thị trên ảnh minh họa.
|
||||||
|
* Tách cấu hình tọa độ và màu sắc rõ ràng thay vì gán cứng trong JSX.
|
||||||
|
*/
|
||||||
|
const TRAFFIC_BOUNDING_BOXES: BoundingBoxItem[] = [
|
||||||
|
{
|
||||||
|
id: 'car',
|
||||||
|
label: 'Ô tô',
|
||||||
|
color: LOGIN_COLORS.boundingBox.carCyan, // #16b9c9
|
||||||
|
position: { left: 248, top: 157, width: 74, height: 65 },
|
||||||
|
badgeWidth: 33,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'bus',
|
||||||
|
label: 'Xe buýt',
|
||||||
|
color: LOGIN_COLORS.boundingBox.busPurple, // #ae7cff
|
||||||
|
position: { left: 155, top: 96, width: 106, height: 87 },
|
||||||
|
badgeWidth: 49,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const PREVIEW_STATS = [
|
||||||
|
{
|
||||||
|
value: '4.320',
|
||||||
|
description: 'ảnh trong không gian nhóm',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'Bạn quyết định',
|
||||||
|
description: 'duyệt nhãn trước khi xuất',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const AI_TASK_TYPES = ['Classification', 'Object Detection', 'Segmentation']
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hàm tạo style cho khung Bounding Box và nhãn tên đối tượng theo màu định nghĩa.
|
||||||
|
*/
|
||||||
|
function getBoundingBoxStyles(box: BoundingBoxItem): {
|
||||||
|
frameStyle: React.CSSProperties
|
||||||
|
badgeStyle: React.CSSProperties
|
||||||
|
} {
|
||||||
|
return {
|
||||||
|
frameStyle: {
|
||||||
|
left: `${box.position.left}px`,
|
||||||
|
top: `${box.position.top}px`,
|
||||||
|
width: `${box.position.width}px`,
|
||||||
|
height: `${box.position.height}px`,
|
||||||
|
...createInsetOutlineStyle(box.color, 2),
|
||||||
|
},
|
||||||
|
badgeStyle: {
|
||||||
|
width: `${box.badgeWidth}px`,
|
||||||
|
backgroundColor: box.color,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const HeroSection: React.FC = () => {
|
export const HeroSection: React.FC = () => {
|
||||||
const [hoveredBox, setHoveredBox] = useState<'bus' | 'car' | null>(null)
|
|
||||||
const [activeTask, setActiveTask] = useState<string>('Object Detection')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col justify-between h-full max-w-[540px]">
|
<div
|
||||||
<div>
|
className="shrink-0 w-full lg:w-[660px] lg:min-h-[900px] flex flex-col items-start gap-[30px] pt-10 pr-14 pb-8 pl-14 overflow-hidden"
|
||||||
<p className="text-[11px] font-semibold uppercase tracking-[0.12em] text-slate-600 mb-3">
|
style={{
|
||||||
|
backgroundColor: LOGIN_COLORS.bgWhite,
|
||||||
|
color: LOGIN_COLORS.textLeftPrimary,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* Thanh thương hiệu phía trên */}
|
||||||
|
<div className="shrink-0 self-stretch flex justify-between items-center overflow-hidden">
|
||||||
|
<div className="shrink-0 flex items-center gap-2.5 overflow-hidden">
|
||||||
|
<img
|
||||||
|
className="shrink-0 w-8 h-8"
|
||||||
|
src="/assets/bi-u-tr-ng.svg"
|
||||||
|
alt="Biểu trưng danable"
|
||||||
|
/>
|
||||||
|
<p className="shrink-0 font-sans text-[25px] font-bold tracking-[-1px] whitespace-nowrap">
|
||||||
|
danable
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p className="shrink-0 font-mono text-[9px] font-normal leading-[14px] whitespace-nowrap">
|
||||||
|
NỀN TẢNG DỮ LIỆU CHO AI
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Tiêu đề & thông điệp chính */}
|
||||||
|
<div className="shrink-0 self-stretch flex flex-col items-start gap-4 pt-[30px] overflow-hidden">
|
||||||
|
<p className="shrink-0 font-sans text-[10px] font-semibold tracking-[1px] whitespace-nowrap">
|
||||||
TỪ DỮ LIỆU THÔ ĐẾN NHÃN CHẤT LƯỢNG
|
TỪ DỮ LIỆU THÔ ĐẾN NHÃN CHẤT LƯỢNG
|
||||||
</p>
|
</p>
|
||||||
|
<h1 className="shrink-0 self-stretch font-sans text-[42px] font-semibold leading-[50px] tracking-[-1px]">
|
||||||
<h1 className="text-4xl sm:text-[42px] font-bold tracking-tight text-slate-900 leading-[1.15] mb-3.5">
|
|
||||||
Giải pháp dữ liệu cho AI
|
Giải pháp dữ liệu cho AI
|
||||||
</h1>
|
</h1>
|
||||||
|
<p className="shrink-0 self-stretch font-sans text-[14px] font-normal leading-[21px]">
|
||||||
<p className="text-[15px] text-slate-600 leading-relaxed mb-7">
|
|
||||||
Kiểm soát chất lượng mô hình AI của bạn từ những bước bắt đầu.
|
Kiểm soát chất lượng mô hình AI của bạn từ những bước bắt đầu.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* Interactive Preview Card */}
|
|
||||||
<div className="rounded-2xl border border-slate-300 bg-white shadow-sm overflow-hidden transition-shadow hover:shadow-md">
|
|
||||||
{/* Card Top Bar */}
|
|
||||||
<div className="flex items-center justify-between px-4 py-3 border-b border-slate-200 bg-white">
|
|
||||||
<span className="text-xs font-medium text-slate-700">
|
|
||||||
Giao thông đô thị
|
|
||||||
</span>
|
|
||||||
<span className="inline-flex items-center gap-1.5 text-xs font-medium text-slate-600">
|
|
||||||
<span className="h-1.5 w-1.5 rounded-full bg-emerald-500" />
|
|
||||||
Đã duyệt thủ công
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Street Traffic Image + Bounding Box Overlays */}
|
{/* Thẻ minh họa gán nhãn giao thông đô thị */}
|
||||||
<div className="relative h-[265px] sm:h-[285px] w-full overflow-hidden bg-slate-900 select-none">
|
<div
|
||||||
|
className="shrink-0 self-stretch flex flex-col items-start rounded-[12px] overflow-hidden"
|
||||||
|
style={{
|
||||||
|
backgroundColor: LOGIN_COLORS.bgPreviewCard,
|
||||||
|
...createInsetOutlineStyle(LOGIN_COLORS.borderPreviewCard, 1),
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* Tiêu đề thẻ minh họa */}
|
||||||
|
<div className="shrink-0 self-stretch flex justify-between items-start p-3.5 overflow-hidden">
|
||||||
|
<p className="shrink-0 font-sans text-[11px] font-normal leading-[17px] whitespace-nowrap">
|
||||||
|
Giao thông đô thị
|
||||||
|
</p>
|
||||||
|
<p className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap">
|
||||||
|
Đã duyệt thủ công
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Ảnh giao thông và các khung Bounding Box */}
|
||||||
|
<div className="shrink-0 h-[272px] w-full max-w-[548px] flex flex-col items-start overflow-hidden relative">
|
||||||
<img
|
<img
|
||||||
src="https://images.unsplash.com/photo-1519003722824-194d4455a60c?auto=format&fit=crop&w=1080&q=85"
|
className="shrink-0 h-[272px] w-[548px] object-cover"
|
||||||
alt="Giao thông đô thị Việt Nam"
|
src="/assets/nh-giao-th-ng.jpg"
|
||||||
className="w-full h-full object-cover object-center brightness-95"
|
alt="Ảnh giao thông"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Subtle road scene gradient for crisp bounding box contrast */}
|
{TRAFFIC_BOUNDING_BOXES.map((box) => {
|
||||||
<div className="absolute inset-0 bg-gradient-to-t from-black/25 via-transparent to-black/10 pointer-events-none" />
|
const { frameStyle, badgeStyle } = getBoundingBoxStyles(box)
|
||||||
|
|
||||||
{/* Purple Bounding Box: Xe buýt */}
|
|
||||||
<div
|
|
||||||
onMouseEnter={() => setHoveredBox('bus')}
|
|
||||||
onMouseLeave={() => setHoveredBox(null)}
|
|
||||||
style={{
|
|
||||||
left: '28%',
|
|
||||||
top: '35%',
|
|
||||||
width: '20%',
|
|
||||||
height: '31%',
|
|
||||||
}}
|
|
||||||
className={`absolute border-2 transition-all duration-150 cursor-pointer ${
|
|
||||||
hoveredBox === 'bus'
|
|
||||||
? 'border-[#A855F7] bg-[#A855F7]/20 shadow-[0_0_0_2px_rgba(168,85,247,0.3)]'
|
|
||||||
: 'border-[#C084FC] bg-[#A855F7]/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<span className="absolute -top-6 left-[-2px] inline-flex items-center px-2 py-0.5 rounded-t-md rounded-br-md bg-[#C084FC] text-slate-950 text-[11px] font-bold shadow-sm whitespace-nowrap">
|
|
||||||
Xe buýt
|
|
||||||
</span>
|
|
||||||
{/* Corner handles */}
|
|
||||||
<span className="absolute -top-1 -left-1 w-2 h-2 bg-white border border-[#A855F7] rounded-full" />
|
|
||||||
<span className="absolute -top-1 -right-1 w-2 h-2 bg-white border border-[#A855F7] rounded-full" />
|
|
||||||
<span className="absolute -bottom-1 -left-1 w-2 h-2 bg-white border border-[#A855F7] rounded-full" />
|
|
||||||
<span className="absolute -bottom-1 -right-1 w-2 h-2 bg-white border border-[#A855F7] rounded-full" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Cyan Bounding Box: Ô tô */}
|
|
||||||
<div
|
|
||||||
onMouseEnter={() => setHoveredBox('car')}
|
|
||||||
onMouseLeave={() => setHoveredBox(null)}
|
|
||||||
style={{
|
|
||||||
left: '45.5%',
|
|
||||||
top: '57%',
|
|
||||||
width: '13.5%',
|
|
||||||
height: '24%',
|
|
||||||
}}
|
|
||||||
className={`absolute border-2 transition-all duration-150 cursor-pointer ${
|
|
||||||
hoveredBox === 'car'
|
|
||||||
? 'border-[#06B6D4] bg-[#06B6D4]/25 shadow-[0_0_0_2px_rgba(6,182,212,0.35)]'
|
|
||||||
: 'border-[#22D3EE] bg-[#06B6D4]/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<span className="absolute -top-6 left-[-2px] inline-flex items-center px-2 py-0.5 rounded-t-md rounded-br-md bg-[#22D3EE] text-slate-950 text-[11px] font-bold shadow-sm whitespace-nowrap">
|
|
||||||
Ô tô
|
|
||||||
</span>
|
|
||||||
{/* Corner handles */}
|
|
||||||
<span className="absolute -top-1 -left-1 w-2 h-2 bg-white border border-[#06B6D4] rounded-full" />
|
|
||||||
<span className="absolute -top-1 -right-1 w-2 h-2 bg-white border border-[#06B6D4] rounded-full" />
|
|
||||||
<span className="absolute -bottom-1 -left-1 w-2 h-2 bg-white border border-[#06B6D4] rounded-full" />
|
|
||||||
<span className="absolute -bottom-1 -right-1 w-2 h-2 bg-white border border-[#06B6D4] rounded-full" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Card Bottom Stats */}
|
|
||||||
<div className="flex items-center justify-between px-5 py-4 bg-white border-t border-slate-200">
|
|
||||||
<div>
|
|
||||||
<div className="text-xl font-bold text-slate-900 tracking-tight">
|
|
||||||
4.320
|
|
||||||
</div>
|
|
||||||
<div className="text-xs text-slate-500 mt-0.5">
|
|
||||||
ảnh trong không gian nhóm
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-right">
|
|
||||||
<div className="text-xl font-bold text-slate-900 tracking-tight">
|
|
||||||
Bạn quyết định
|
|
||||||
</div>
|
|
||||||
<div className="text-xs text-slate-500 mt-0.5">
|
|
||||||
duyệt nhãn trước khi xuất
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Bottom Task Tags */}
|
|
||||||
<div className="flex items-center gap-6 mt-6">
|
|
||||||
{(['Classification', 'Object Detection', 'Segmentation'] as const).map(
|
|
||||||
(task) => {
|
|
||||||
const isSelected = activeTask === task
|
|
||||||
return (
|
return (
|
||||||
<button
|
<div
|
||||||
key={task}
|
key={box.id}
|
||||||
type="button"
|
className="absolute flex flex-col items-start"
|
||||||
onClick={() => setActiveTask(task)}
|
style={frameStyle}
|
||||||
className={`text-xs transition-colors ${
|
|
||||||
isSelected
|
|
||||||
? 'font-semibold text-slate-900 underline decoration-[#C95C3C] decoration-2 underline-offset-4'
|
|
||||||
: 'font-medium text-slate-600 hover:text-slate-900'
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{task}
|
<div
|
||||||
</button>
|
className="absolute left-[-2px] top-[-22px] h-[21px] flex items-start py-[3px] px-1.5 overflow-hidden"
|
||||||
|
style={badgeStyle}
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
className="shrink-0 font-sans text-[10px] font-semibold leading-[15px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.textLeftPrimary }}
|
||||||
|
>
|
||||||
|
{box.label}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
})}
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
|
{/* Thông số thống kê bên dưới ảnh */}
|
||||||
|
<div className="shrink-0 self-stretch flex justify-between items-start p-4 overflow-hidden">
|
||||||
|
{PREVIEW_STATS.map((stat) => (
|
||||||
|
<div
|
||||||
|
key={stat.value}
|
||||||
|
className="shrink-0 flex flex-col items-start gap-[3px] overflow-hidden"
|
||||||
|
>
|
||||||
|
<p className="shrink-0 font-sans text-[20px] font-semibold leading-[30px] whitespace-nowrap">
|
||||||
|
{stat.value}
|
||||||
|
</p>
|
||||||
|
<p className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap">
|
||||||
|
{stat.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Footer Copyright */}
|
{/* Các loại bài toán gán nhãn hỗ trợ */}
|
||||||
<p className="text-xs text-slate-500 mt-8">
|
<div className="shrink-0 flex items-start gap-5 overflow-hidden">
|
||||||
|
{AI_TASK_TYPES.map((taskName) => (
|
||||||
|
<p
|
||||||
|
key={taskName}
|
||||||
|
className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{taskName}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Bản quyền */}
|
||||||
|
<p className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap">
|
||||||
© 2026 danable. Dữ liệu của bạn, quyền kiểm soát của bạn.
|
© 2026 danable. Dữ liệu của bạn, quyền kiểm soát của bạn.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { LoginRequest } from '../../../types'
|
import { LoginRequest } from '@/types'
|
||||||
|
import { LOGIN_COLORS, createInsetOutlineStyle } from '@/styles/theme'
|
||||||
import { SSOButton } from './SSOButton'
|
import { SSOButton } from './SSOButton'
|
||||||
|
|
||||||
export interface LoginFormProps {
|
export interface LoginFormProps {
|
||||||
|
|
@ -38,196 +39,194 @@ export const LoginForm: React.FC<LoginFormProps> = ({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const inputBoxOutlineStyle = createInsetOutlineStyle(
|
||||||
|
LOGIN_COLORS.borderControl,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full max-w-[420px] mx-auto">
|
<form
|
||||||
{/* Header */}
|
onSubmit={handleSubmit}
|
||||||
<div className="mb-6">
|
noValidate
|
||||||
<p className="text-[11px] font-semibold uppercase tracking-[0.08em] text-indigo-600 mb-2">
|
className="shrink-0 w-full max-w-[416px] flex flex-col items-start gap-6 overflow-hidden"
|
||||||
|
>
|
||||||
|
{/* Phần tiêu đề chào mừng */}
|
||||||
|
<div className="shrink-0 self-stretch flex flex-col items-start gap-2.5 overflow-hidden">
|
||||||
|
<p
|
||||||
|
className="shrink-0 font-sans text-[10px] font-semibold leading-[15px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.brandAccentIndigo }}
|
||||||
|
>
|
||||||
CHÀO MỪNG TRỞ LẠI
|
CHÀO MỪNG TRỞ LẠI
|
||||||
</p>
|
</p>
|
||||||
<h2 className="text-[28px] font-bold text-slate-900 tracking-tight leading-tight mb-2">
|
<h2
|
||||||
|
className="shrink-0 font-sans text-[30px] font-normal tracking-[-1px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
|
>
|
||||||
Đăng nhập vào danable
|
Đăng nhập vào danable
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-sm text-slate-500">
|
<p
|
||||||
|
className="shrink-0 self-stretch font-sans text-[13px] font-normal leading-[20px]"
|
||||||
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
|
>
|
||||||
Tiếp tục xây dựng bộ dữ liệu tốt hơn, cùng đội ngũ của bạn.
|
Tiếp tục xây dựng bộ dữ liệu tốt hơn, cùng đội ngũ của bạn.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* SSO Button */}
|
{/* Nút đăng nhập bằng SSO công ty */}
|
||||||
<SSOButton onClick={onSSOLogin} isLoading={isLoading} />
|
<SSOButton onClick={onSSOLogin} isLoading={isLoading} />
|
||||||
|
|
||||||
{/* Divider */}
|
{/* Đường phân cách "hoặc sử dụng email" */}
|
||||||
<div className="relative flex items-center justify-center my-6">
|
<div className="shrink-0 self-stretch flex items-center gap-3.5 overflow-hidden">
|
||||||
<div className="w-full border-t border-slate-200" />
|
<div
|
||||||
<span className="bg-white px-3 text-xs text-slate-400 whitespace-nowrap">
|
className="flex-1 min-w-0 h-[1px]"
|
||||||
|
style={{ backgroundColor: LOGIN_COLORS.borderControl }}
|
||||||
|
/>
|
||||||
|
<p
|
||||||
|
className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.textMuted }}
|
||||||
|
>
|
||||||
hoặc sử dụng email
|
hoặc sử dụng email
|
||||||
</span>
|
</p>
|
||||||
<div className="w-full border-t border-slate-200" />
|
<div
|
||||||
|
className="flex-1 min-w-0 h-[1px]"
|
||||||
|
style={{ backgroundColor: LOGIN_COLORS.borderControl }}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Error Alert */}
|
{/* Thông báo lỗi nếu có */}
|
||||||
{errorMessage && (
|
{errorMessage && (
|
||||||
<div className="mb-4 px-3.5 py-2.5 rounded-lg bg-red-50 border border-red-200 text-xs text-red-700">
|
<div className="self-stretch px-3.5 py-2.5 rounded-[8px] bg-red-50 border border-red-200 text-xs text-red-700">
|
||||||
{errorMessage}
|
{errorMessage}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Form */}
|
{/* Trường nhập Email công việc */}
|
||||||
<form onSubmit={handleSubmit} className="space-y-4" noValidate>
|
<div className="shrink-0 self-stretch flex flex-col items-start gap-2 overflow-hidden">
|
||||||
{/* Email Field */}
|
|
||||||
<div>
|
|
||||||
<label
|
<label
|
||||||
htmlFor="work-email"
|
htmlFor="work-email"
|
||||||
className="block text-[13px] font-medium text-slate-800 mb-1.5"
|
className="shrink-0 font-sans text-[13px] font-medium leading-[20px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
>
|
>
|
||||||
Email công việc
|
Email công việc
|
||||||
</label>
|
</label>
|
||||||
<div className="relative">
|
<div
|
||||||
<span className="absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400">
|
className="shrink-0 h-12 self-stretch flex items-center gap-3 py-0 px-3.5 rounded-[8px] overflow-hidden"
|
||||||
<svg
|
style={inputBoxOutlineStyle}
|
||||||
className="w-4 h-4"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.8"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
>
|
||||||
<rect x="2" y="4" width="20" height="16" rx="2" />
|
<img
|
||||||
<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" />
|
className="shrink-0 w-4 h-4"
|
||||||
</svg>
|
src="/assets/mail.svg"
|
||||||
</span>
|
alt="Biểu tượng email"
|
||||||
|
/>
|
||||||
<input
|
<input
|
||||||
id="work-email"
|
id="work-email"
|
||||||
type="email"
|
type="email"
|
||||||
value={email}
|
value={email}
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
placeholder="name@company.vn"
|
placeholder="minhanh@visionlab.vn"
|
||||||
className="w-full pl-10 pr-4 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:border-[#C95C3C] focus:ring-2 focus:ring-[#C95C3C]/15 transition-all"
|
className="flex-1 min-w-0 bg-transparent font-sans text-[13px] font-normal leading-[20px] focus:outline-none"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Password Field */}
|
{/* Trường nhập Mật khẩu */}
|
||||||
<div>
|
<div className="shrink-0 self-stretch flex flex-col items-start gap-2 overflow-hidden">
|
||||||
<label
|
<label
|
||||||
htmlFor="work-password"
|
htmlFor="work-password"
|
||||||
className="block text-[13px] font-medium text-slate-800 mb-1.5"
|
className="shrink-0 font-sans text-[13px] font-medium leading-[20px] whitespace-nowrap"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
>
|
>
|
||||||
Mật khẩu
|
Mật khẩu
|
||||||
</label>
|
</label>
|
||||||
<div className="relative">
|
<div
|
||||||
<span className="absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400">
|
className="shrink-0 h-12 self-stretch flex items-center gap-3 py-0 px-3.5 rounded-[8px] overflow-hidden"
|
||||||
<svg
|
style={inputBoxOutlineStyle}
|
||||||
className="w-4 h-4"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.8"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
>
|
||||||
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
|
<img
|
||||||
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
|
className="shrink-0 w-4 h-4"
|
||||||
</svg>
|
src="/assets/lock-keyhole.svg"
|
||||||
</span>
|
alt="Biểu tượng khóa"
|
||||||
|
/>
|
||||||
<input
|
<input
|
||||||
id="work-password"
|
id="work-password"
|
||||||
type={showPassword ? 'text' : 'password'}
|
type={showPassword ? 'text' : 'password'}
|
||||||
value={password}
|
value={password}
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
placeholder="Nhập mật khẩu"
|
placeholder="••••••••••••"
|
||||||
className="w-full pl-10 pr-10 py-2.5 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:border-[#C95C3C] focus:ring-2 focus:ring-[#C95C3C]/15 transition-all"
|
className="flex-1 min-w-0 bg-transparent font-sans text-[13px] font-normal leading-[20px] focus:outline-none"
|
||||||
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setShowPassword((prev) => !prev)}
|
onClick={() => setShowPassword((prev) => !prev)}
|
||||||
aria-label={showPassword ? 'Ẩn mật khẩu' : 'Hiện mật khẩu'}
|
aria-label={showPassword ? 'Ẩn mật khẩu' : 'Hiện mật khẩu'}
|
||||||
className="absolute inset-y-0 right-0 pr-3.5 flex items-center text-slate-500 hover:text-slate-700"
|
className="shrink-0 flex items-center justify-center"
|
||||||
>
|
>
|
||||||
{showPassword ? (
|
<img
|
||||||
<svg
|
className="shrink-0 w-4 h-4"
|
||||||
className="w-4 h-4"
|
src="/assets/eye-off.svg"
|
||||||
viewBox="0 0 24 24"
|
alt="Ẩn/hiện mật khẩu"
|
||||||
fill="none"
|
/>
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.8"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
|
|
||||||
<circle cx="12" cy="12" r="3" />
|
|
||||||
</svg>
|
|
||||||
) : (
|
|
||||||
<svg
|
|
||||||
className="w-4 h-4"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="1.8"
|
|
||||||
strokeLinecap="round"
|
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24" />
|
|
||||||
<path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" />
|
|
||||||
<path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" />
|
|
||||||
<line x1="2" x2="22" y1="2" y2="22" />
|
|
||||||
</svg>
|
|
||||||
)}
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Remember Me & Forgot Password */}
|
{/* Ghi nhớ đăng nhập & Quên mật khẩu */}
|
||||||
<div className="flex items-center justify-between pt-1">
|
<div className="shrink-0 self-stretch flex justify-between items-start overflow-hidden">
|
||||||
<label className="inline-flex items-center gap-2 cursor-pointer select-none">
|
<button
|
||||||
<input
|
type="button"
|
||||||
type="checkbox"
|
onClick={() => setRememberMe((prev) => !prev)}
|
||||||
checked={rememberMe}
|
className="shrink-0 font-sans text-[12px] font-normal leading-[18px] whitespace-nowrap text-left"
|
||||||
onChange={(e) => setRememberMe(e.target.checked)}
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
className="w-4 h-4 rounded border-slate-300 text-slate-700 focus:ring-slate-500 accent-slate-600"
|
>
|
||||||
/>
|
{rememberMe ? '☑ Ghi nhớ đăng nhập' : '☐ Ghi nhớ đăng nhập'}
|
||||||
<span className="text-xs text-slate-600">Ghi nhớ đăng nhập</span>
|
</button>
|
||||||
</label>
|
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
to="/forgot-password"
|
to="/forgot-password"
|
||||||
className="text-xs font-medium text-indigo-600 hover:text-indigo-700 hover:underline"
|
className="shrink-0 font-sans text-[12px] font-normal leading-[18px] whitespace-nowrap hover:underline"
|
||||||
|
style={{ color: LOGIN_COLORS.brandAccentIndigo }}
|
||||||
>
|
>
|
||||||
Quên mật khẩu?
|
Quên mật khẩu?
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Terracotta Submit Button */}
|
{/* Nút Đăng nhập chính */}
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl bg-[#C95C3C] hover:bg-[#B5492B] active:bg-[#A03E22] text-white text-sm font-semibold shadow-sm transition-colors disabled:opacity-60 mt-2"
|
className="shrink-0 h-12 self-stretch flex justify-center items-center gap-3 rounded-[8px] overflow-hidden transition-opacity hover:opacity-95 disabled:opacity-60"
|
||||||
|
style={{ backgroundColor: LOGIN_COLORS.brandOrangeRed }}
|
||||||
>
|
>
|
||||||
<span>{isLoading ? 'Đang đăng nhập...' : 'Đăng nhập'}</span>
|
<span
|
||||||
<span aria-hidden="true" className="text-base leading-none">
|
className="shrink-0 font-sans text-[13px] font-semibold leading-[20px] whitespace-nowrap"
|
||||||
→
|
style={{ color: LOGIN_COLORS.textOnBrand }}
|
||||||
|
>
|
||||||
|
{isLoading ? 'Đang đăng nhập...' : 'Đăng nhập'}
|
||||||
</span>
|
</span>
|
||||||
|
<img
|
||||||
|
className="shrink-0 w-4 h-4"
|
||||||
|
src="/assets/arrow-right.svg"
|
||||||
|
alt="Mũi tên tiếp tục"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
|
||||||
|
|
||||||
{/* Security Badge */}
|
{/* Cam kết bảo mật */}
|
||||||
<div className="flex items-center justify-center gap-1.5 mt-5 text-xs text-slate-500">
|
<div className="shrink-0 self-stretch flex justify-center items-start gap-[7px] overflow-hidden">
|
||||||
<svg
|
<img
|
||||||
className="w-3.5 h-3.5 text-slate-500 shrink-0"
|
className="shrink-0 w-[13px] h-[13px]"
|
||||||
viewBox="0 0 24 24"
|
src="/assets/shield-check.svg"
|
||||||
fill="none"
|
alt="Biểu tượng bảo mật"
|
||||||
stroke="currentColor"
|
/>
|
||||||
strokeWidth="2"
|
<p
|
||||||
strokeLinecap="round"
|
className="shrink-0 font-sans text-[10px] font-normal leading-[15px] whitespace-nowrap"
|
||||||
strokeLinejoin="round"
|
style={{ color: LOGIN_COLORS.textSecondary }}
|
||||||
>
|
>
|
||||||
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10" />
|
Kết nối được mã hóa. Dữ liệu luôn riêng tư.
|
||||||
<path d="m9 12 2 2 4-4" />
|
</p>
|
||||||
</svg>
|
|
||||||
<span>Kết nối được mã hóa. Dữ liệu luôn riêng tư.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { LOGIN_COLORS, createInsetOutlineStyle } from '@/styles/theme'
|
||||||
|
|
||||||
export interface SSOButtonProps {
|
export interface SSOButtonProps {
|
||||||
onClick?: () => void
|
onClick?: () => void
|
||||||
|
|
@ -14,31 +15,20 @@ export const SSOButton: React.FC<SSOButtonProps> = ({
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={isLoading}
|
disabled={isLoading}
|
||||||
className="w-full flex items-center justify-center gap-2.5 px-4 py-3 rounded-xl border border-slate-200 bg-white text-slate-800 text-sm font-medium hover:bg-slate-50 hover:border-slate-300 active:bg-slate-100 transition-all disabled:opacity-60"
|
className="shrink-0 h-[46px] self-stretch flex justify-center items-center gap-2.5 rounded-[8px] overflow-hidden hover:bg-slate-50 transition-colors disabled:opacity-60"
|
||||||
|
style={createInsetOutlineStyle(LOGIN_COLORS.borderControl, 1)}
|
||||||
>
|
>
|
||||||
{/* Building Icon */}
|
<img
|
||||||
<svg
|
className="shrink-0 w-4 h-4"
|
||||||
className="w-4 h-4 text-slate-600 shrink-0"
|
src="/assets/building-2.svg"
|
||||||
viewBox="0 0 24 24"
|
alt="Biểu tượng SSO công ty"
|
||||||
fill="none"
|
/>
|
||||||
stroke="currentColor"
|
<span
|
||||||
strokeWidth="1.8"
|
className="shrink-0 font-sans text-[13px] font-medium leading-[20px] whitespace-nowrap"
|
||||||
strokeLinecap="round"
|
style={{ color: LOGIN_COLORS.textRightPrimary }}
|
||||||
strokeLinejoin="round"
|
|
||||||
>
|
>
|
||||||
<rect x="4" y="2" width="16" height="20" rx="2" ry="2" />
|
Đăng nhập bằng SSO công ty
|
||||||
<path d="M9 22v-4h6v4" />
|
</span>
|
||||||
<path d="M8 6h.01" />
|
|
||||||
<path d="M16 6h.01" />
|
|
||||||
<path d="M12 6h.01" />
|
|
||||||
<path d="M12 10h.01" />
|
|
||||||
<path d="M12 14h.01" />
|
|
||||||
<path d="M16 10h.01" />
|
|
||||||
<path d="M16 14h.01" />
|
|
||||||
<path d="M8 10h.01" />
|
|
||||||
<path d="M8 14h.01" />
|
|
||||||
</svg>
|
|
||||||
<span>Đăng nhập bằng SSO công ty</span>
|
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-5">
|
||||||
{/* Hidden file input for header "↑ Tải ảnh lên" button */}
|
{/* Hidden file input for header "↑ Tải ảnh lên" button */}
|
||||||
<input
|
<input
|
||||||
ref={fileInputRef}
|
ref={fileInputRef}
|
||||||
|
|
@ -77,13 +77,13 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Top Header matching MVP · Project dashboard.png */}
|
{/* Top Header matching MVP · Project dashboard.png */}
|
||||||
<div className="flex flex-wrap items-start justify-between gap-4">
|
<div className="flex flex-wrap items-center justify-between gap-4">
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<h1 className="text-[28px] font-bold leading-tight tracking-tight text-slate-900">
|
<h1 className="text-[27px] font-medium leading-tight tracking-[-0.03em] text-[var(--project-heading)]">
|
||||||
{project.name}
|
{project.name}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="mt-1 text-xs text-slate-500">
|
<p className="mt-1.5 text-xs leading-[18px] text-[var(--project-body)]">
|
||||||
<span className="font-mono text-slate-600">{project.slug}</span>
|
<span className="font-mono text-[var(--project-body)]">{project.slug}</span>
|
||||||
{' · '}
|
{' · '}
|
||||||
<span>{TASK_DISPLAY_NAME[project.taskType]}</span>
|
<span>{TASK_DISPLAY_NAME[project.taskType]}</span>
|
||||||
{' · '}
|
{' · '}
|
||||||
|
|
@ -93,14 +93,14 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-3">
|
<div className="flex flex-wrap items-center gap-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
className="inline-flex h-10 items-center gap-2 rounded-xl border border-slate-200 bg-white px-4 text-xs font-bold text-slate-800 shadow-sm transition hover:bg-slate-50"
|
className="inline-flex h-10 items-center gap-2 rounded-lg border border-[var(--project-border)] bg-white px-4 text-[13px] font-semibold text-[var(--project-heading)] transition hover:bg-[var(--project-canvas)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/30"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
className="h-4 w-4 text-slate-700"
|
className="h-4 w-4 text-[var(--project-heading)]"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
@ -118,17 +118,19 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => navigate(`/projects/${project.id}/annotate`)}
|
onClick={() => navigate(`/projects/${project.id}/annotate`)}
|
||||||
className="inline-flex h-10 items-center gap-2 rounded-xl bg-[#C95C3C] px-5 text-xs font-bold text-white shadow-sm transition hover:bg-[#B5492B]"
|
className="inline-flex h-10 items-center gap-2 rounded-lg border border-[var(--project-accent)] bg-[var(--brand-primary)] px-4 text-[13px] font-semibold text-white transition hover:bg-[var(--brand-primary-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/40"
|
||||||
>
|
>
|
||||||
<span>↗</span>
|
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" aria-hidden="true">
|
||||||
|
<path strokeLinecap="round" strokeLinejoin="round" d="M7 17 17 7M8 7h9v9" />
|
||||||
|
</svg>
|
||||||
<span>Mở giao diện gán nhãn</span>
|
<span>Mở giao diện gán nhãn</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs navigation matching MVP · Project dashboard.png */}
|
{/* Tabs navigation matching MVP · Project dashboard.png */}
|
||||||
<div className="border-b border-slate-200">
|
<div className="border-b border-[var(--project-border)]">
|
||||||
<nav className="-mb-px flex flex-wrap gap-6">
|
<nav className="-mb-px flex flex-wrap gap-7" aria-label="Điều hướng dự án">
|
||||||
{TABS.map((tab) => {
|
{TABS.map((tab) => {
|
||||||
const isActive = activeTab === tab.key
|
const isActive = activeTab === tab.key
|
||||||
return (
|
return (
|
||||||
|
|
@ -136,10 +138,10 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
key={tab.key}
|
key={tab.key}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setActiveTab(tab.key)}
|
onClick={() => setActiveTab(tab.key)}
|
||||||
className={`border-b-2 pb-2.5 text-xs font-semibold transition ${
|
className={`flex h-[38px] items-center border-b-2 text-[13px] transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--project-accent)]/30 ${
|
||||||
isActive
|
isActive
|
||||||
? 'border-indigo-600 text-indigo-600'
|
? 'border-[var(--project-accent)] font-semibold text-[var(--project-accent)]'
|
||||||
: 'border-transparent text-slate-500 hover:border-slate-300 hover:text-slate-800'
|
: 'border-transparent font-normal text-[var(--project-body)] hover:text-[var(--project-heading)]'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{tab.label}
|
{tab.label}
|
||||||
|
|
@ -150,7 +152,7 @@ export const ProjectDetailPage: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tab Content */}
|
{/* Tab Content */}
|
||||||
<div className="pt-1">
|
<div className="pt-0">
|
||||||
{activeTab === 'overview' && (
|
{activeTab === 'overview' && (
|
||||||
<OverviewTab
|
<OverviewTab
|
||||||
project={project}
|
project={project}
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,10 @@ export const ExportButton: React.FC<ExportButtonProps> = ({
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
onClick={() => setOpen((prev) => !prev)}
|
||||||
className="inline-flex h-10 items-center gap-2 rounded-xl border border-slate-200 bg-white px-4 text-xs font-bold text-slate-800 shadow-sm transition hover:bg-slate-50"
|
className="inline-flex h-10 items-center gap-2 rounded-lg border border-[var(--project-border)] bg-white px-4 text-xs font-semibold text-[var(--project-heading)] transition hover:bg-[var(--project-canvas)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/30"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
className="h-4 w-4 text-slate-600"
|
className="h-4 w-4 text-[var(--project-body)]"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
@ -69,7 +69,7 @@ export const ExportButton: React.FC<ExportButtonProps> = ({
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{open && (
|
{open && (
|
||||||
<div className="absolute right-0 top-11 z-20 w-52 rounded-xl border border-slate-200 bg-white py-1.5 shadow-lg">
|
<div className="absolute right-0 top-11 z-20 w-52 rounded-lg border border-[var(--project-border)] bg-white py-1.5 shadow-lg">
|
||||||
<div className="px-3.5 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-slate-400">
|
<div className="px-3.5 py-1.5 text-[11px] font-semibold uppercase tracking-wider text-slate-400">
|
||||||
Định dạng xuất
|
Định dạng xuất
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,27 +17,27 @@ const STATUS_BADGE_MAP: Record<
|
||||||
> = {
|
> = {
|
||||||
pending_review: {
|
pending_review: {
|
||||||
label: 'Chờ duyệt',
|
label: 'Chờ duyệt',
|
||||||
bg: 'bg-[#FEF3C7]',
|
bg: 'bg-[var(--project-status-review-bg)]',
|
||||||
text: 'text-[#B45309]',
|
text: 'text-[var(--project-status-review-text)]',
|
||||||
dot: 'bg-[#F59E0B]',
|
dot: 'bg-[var(--project-status-review-dot)]',
|
||||||
},
|
},
|
||||||
in_progress: {
|
in_progress: {
|
||||||
label: 'Đang làm',
|
label: 'Đang làm',
|
||||||
bg: 'bg-[#FEE2E2]/80',
|
bg: 'bg-[var(--project-status-active-bg)]',
|
||||||
text: 'text-[#B91C1C]',
|
text: 'text-[var(--project-status-active-text)]',
|
||||||
dot: 'bg-[#EF4444]',
|
dot: 'bg-[var(--brand-primary)]',
|
||||||
},
|
},
|
||||||
completed: {
|
completed: {
|
||||||
label: 'Hoàn thành',
|
label: 'Hoàn thành',
|
||||||
bg: 'bg-[#DCFCE7]',
|
bg: 'bg-[var(--project-status-complete-bg)]',
|
||||||
text: 'text-[#15803D]',
|
text: 'text-[var(--project-status-complete-text)]',
|
||||||
dot: 'bg-[#22C55E]',
|
dot: 'bg-[var(--project-status-complete-text)]',
|
||||||
},
|
},
|
||||||
unassigned: {
|
unassigned: {
|
||||||
label: 'Chưa gán nhãn',
|
label: 'Chưa gán nhãn',
|
||||||
bg: 'bg-slate-100',
|
bg: 'bg-[var(--project-status-draft-bg)]',
|
||||||
text: 'text-slate-600',
|
text: 'text-[var(--project-status-draft-text)]',
|
||||||
dot: 'bg-slate-400',
|
dot: 'bg-[var(--project-status-draft-text)]',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,12 +77,12 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
const formatNum = (n: number) => n.toLocaleString('vi-VN')
|
const formatNum = (n: number) => n.toLocaleString('vi-VN')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden rounded-2xl border border-slate-200/80 bg-white shadow-[0_1px_2px_rgba(15,23,42,0.03)]">
|
<div className="overflow-hidden rounded-xl border border-[var(--project-border)] bg-[var(--project-surface)]">
|
||||||
{/* Top Header + Filter Bar */}
|
{/* Top Header + Filter Bar */}
|
||||||
<div className="p-5">
|
<div className="p-[18px]">
|
||||||
<div className="mb-4 flex items-center justify-between">
|
<div className="mb-4 flex items-center justify-between">
|
||||||
<h3 className="text-base font-bold text-slate-900">Danh sách ảnh</h3>
|
<h3 className="text-sm font-semibold text-[var(--project-heading)]">Danh sách ảnh</h3>
|
||||||
<span className="text-xs font-medium text-indigo-600">
|
<span className="text-[11px] text-[var(--project-accent)]">
|
||||||
{formatNum(stats.totalImages)} ảnh · {formatNum(totalObjects)} đối tượng
|
{formatNum(stats.totalImages)} ảnh · {formatNum(totalObjects)} đối tượng
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -105,7 +105,7 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
<div className="overflow-x-auto">
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full border-collapse text-left">
|
<table className="w-full border-collapse text-left">
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="border-y border-slate-200/70 bg-slate-50/70 text-[11px] font-bold uppercase tracking-wider text-slate-400">
|
<tr className="border-y border-[var(--project-border)] bg-[var(--project-canvas)] text-[10px] font-semibold tracking-[0.04em] text-[var(--project-body)]">
|
||||||
<th className="py-3 pl-5 pr-4">TÊN ẢNH</th>
|
<th className="py-3 pl-5 pr-4">TÊN ẢNH</th>
|
||||||
<th className="px-4 py-3">TRẠNG THÁI</th>
|
<th className="px-4 py-3">TRẠNG THÁI</th>
|
||||||
<th className="px-4 py-3">NHÃN</th>
|
<th className="px-4 py-3">NHÃN</th>
|
||||||
|
|
@ -113,10 +113,10 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
<th className="py-3 pl-4 pr-5">THAO TÁC</th>
|
<th className="py-3 pl-4 pr-5">THAO TÁC</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-slate-100 text-xs">
|
<tbody className="divide-y divide-[var(--project-border)] text-xs">
|
||||||
{filteredImages.length === 0 ? (
|
{filteredImages.length === 0 ? (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={5} className="py-10 text-center text-slate-400">
|
<td colSpan={5} className="py-10 text-center text-[var(--project-body)]">
|
||||||
Không tìm thấy ảnh phù hợp với bộ lọc hiện tại.
|
Không tìm thấy ảnh phù hợp với bộ lọc hiện tại.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -129,20 +129,20 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate(`/projects/${projectId}/annotate?imageId=${image.id}`)
|
navigate(`/projects/${projectId}/annotate?imageId=${image.id}`)
|
||||||
}
|
}
|
||||||
className="cursor-pointer transition hover:bg-slate-50/80"
|
className="h-16 cursor-pointer transition hover:bg-[var(--project-canvas)]"
|
||||||
>
|
>
|
||||||
<td className="py-3.5 pl-5 pr-4">
|
<td className="py-3.5 pl-5 pr-4">
|
||||||
<div className="flex items-center gap-3.5">
|
<div className="flex items-center gap-3">
|
||||||
<img
|
<img
|
||||||
src={image.thumbnailUrl}
|
src={image.thumbnailUrl}
|
||||||
alt={image.fileName}
|
alt={image.fileName}
|
||||||
className="h-9 w-14 rounded-lg object-cover border border-slate-200/60 shrink-0"
|
className="h-9 w-[54px] shrink-0 rounded object-cover"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<p className="font-mono text-xs font-semibold text-slate-900">
|
<p className="font-mono text-[11px] text-[var(--project-heading)]">
|
||||||
{image.fileName}
|
{image.fileName}
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-0.5 text-[11px] text-slate-400">
|
<p className="text-[9px] text-[var(--project-muted)]">
|
||||||
{image.width} × {image.height} px
|
{image.width} × {image.height} px
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -151,18 +151,18 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
|
|
||||||
<td className="px-4 py-3.5">
|
<td className="px-4 py-3.5">
|
||||||
<span
|
<span
|
||||||
className={`inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold ${badge.bg} ${badge.text}`}
|
className={`inline-flex items-center gap-[5px] rounded-md px-2 py-1 text-[11px] font-medium ${badge.bg} ${badge.text}`}
|
||||||
>
|
>
|
||||||
<span className={`h-1.5 w-1.5 rounded-full ${badge.dot}`} />
|
<span className={`h-1.5 w-1.5 rounded-full ${badge.dot}`} />
|
||||||
{badge.label}
|
{badge.label}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td className="px-4 py-3.5 text-slate-600">
|
<td className="px-4 py-3.5 text-[11px] text-[var(--project-body)]">
|
||||||
{image.objectCount} đối tượng
|
{image.objectCount} đối tượng
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td className="px-4 py-3.5 font-semibold text-slate-800">
|
<td className="px-4 py-3.5 text-[11px] text-[var(--project-heading)]">
|
||||||
{image.assignedTo.name}
|
{image.assignedTo.name}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
@ -173,7 +173,7 @@ export const ImageTable: React.FC<ImageTableProps> = ({
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
navigate(`/projects/${projectId}/annotate?imageId=${image.id}`)
|
navigate(`/projects/${projectId}/annotate?imageId=${image.id}`)
|
||||||
}}
|
}}
|
||||||
className="font-semibold text-indigo-600 hover:text-indigo-700 transition"
|
className="text-[11px] font-medium text-[var(--project-accent)] transition hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/30"
|
||||||
>
|
>
|
||||||
Mở ảnh →
|
Mở ảnh →
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
{/* Search Input */}
|
{/* Search Input */}
|
||||||
<div className="relative w-full sm:w-64">
|
<div className="relative w-full sm:w-64">
|
||||||
<svg
|
<svg
|
||||||
className="pointer-events-none absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"
|
className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--project-body)]"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
@ -50,7 +50,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={(e) => onSearchChange(e.target.value)}
|
onChange={(e) => onSearchChange(e.target.value)}
|
||||||
placeholder="Tìm tên ảnh..."
|
placeholder="Tìm tên ảnh..."
|
||||||
className="h-10 w-full rounded-xl border border-slate-200 bg-white pl-10 pr-4 text-xs text-slate-800 placeholder:text-slate-400 focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/15"
|
className="h-10 w-full rounded-lg border border-[var(--project-border)] bg-white pl-9 pr-3 text-xs text-[var(--project-heading)] placeholder:text-[var(--project-muted)] focus:border-[var(--project-accent)] focus:outline-none focus:ring-2 focus:ring-[var(--project-accent)]/15"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
<select
|
<select
|
||||||
value={selectedStatus}
|
value={selectedStatus}
|
||||||
onChange={(e) => onStatusChange(e.target.value as 'all' | ImageAnnotationStatus)}
|
onChange={(e) => onStatusChange(e.target.value as 'all' | ImageAnnotationStatus)}
|
||||||
className="h-10 appearance-none rounded-xl border border-slate-200 bg-white pl-3.5 pr-9 text-xs font-medium text-slate-700 focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/15"
|
className="h-10 appearance-none rounded-lg border border-[var(--project-border)] bg-white pl-3.5 pr-9 text-xs font-normal text-[var(--project-heading)] focus:border-[var(--project-accent)] focus:outline-none focus:ring-2 focus:ring-[var(--project-accent)]/15"
|
||||||
>
|
>
|
||||||
<option value="all">Tất cả trạng thái</option>
|
<option value="all">Tất cả trạng thái</option>
|
||||||
<option value="pending_review">Chờ duyệt</option>
|
<option value="pending_review">Chờ duyệt</option>
|
||||||
|
|
@ -68,7 +68,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
<option value="unassigned">Chưa gán nhãn</option>
|
<option value="unassigned">Chưa gán nhãn</option>
|
||||||
</select>
|
</select>
|
||||||
<svg
|
<svg
|
||||||
className="pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-500"
|
className="pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--project-body)]"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
@ -83,7 +83,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
<select
|
<select
|
||||||
value={selectedMember}
|
value={selectedMember}
|
||||||
onChange={(e) => onMemberChange(e.target.value)}
|
onChange={(e) => onMemberChange(e.target.value)}
|
||||||
className="h-10 appearance-none rounded-xl border border-slate-200 bg-white pl-3.5 pr-9 text-xs font-medium text-slate-700 focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/15"
|
className="h-10 appearance-none rounded-lg border border-[var(--project-border)] bg-white pl-3.5 pr-9 text-xs font-normal text-[var(--project-heading)] focus:border-[var(--project-accent)] focus:outline-none focus:ring-2 focus:ring-[var(--project-accent)]/15"
|
||||||
>
|
>
|
||||||
<option value="all">Tất cả thành viên</option>
|
<option value="all">Tất cả thành viên</option>
|
||||||
{memberNames.map((name) => (
|
{memberNames.map((name) => (
|
||||||
|
|
@ -93,7 +93,7 @@ export const ImageTableFilters: React.FC<ImageTableFiltersProps> = ({
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
<svg
|
<svg
|
||||||
className="pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-500"
|
className="pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--project-body)]"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
|
|
|
||||||
|
|
@ -20,31 +20,31 @@ export const LabelDistribution: React.FC<LabelDistributionProps> = ({
|
||||||
const formatNum = (n: number) => n.toLocaleString('vi-VN')
|
const formatNum = (n: number) => n.toLocaleString('vi-VN')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col justify-between rounded-2xl border border-slate-200/80 bg-white p-5 shadow-[0_1px_2px_rgba(15,23,42,0.03)]">
|
<div className="flex h-full flex-col justify-between overflow-hidden rounded-xl border border-[var(--project-border)] bg-[var(--project-surface)]">
|
||||||
<div>
|
<div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex h-[52px] items-center justify-between px-[18px]">
|
||||||
<h3 className="text-base font-bold text-slate-900">Lớp nhãn</h3>
|
<h3 className="text-sm font-semibold text-[var(--project-heading)]">Lớp nhãn</h3>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onManageLabels}
|
onClick={onManageLabels}
|
||||||
className="text-xs font-semibold text-indigo-600 hover:text-indigo-700 transition"
|
className="text-[11px] text-[var(--project-accent)] transition hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/30"
|
||||||
>
|
>
|
||||||
Quản lý {classes.length} lớp →
|
Quản lý {classes.length} lớp →
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 4 columns with colored dots matching MVP · Project dashboard.png */}
|
{/* 4 columns with colored dots matching MVP · Project dashboard.png */}
|
||||||
<div className="mt-5 grid grid-cols-2 gap-4 sm:grid-cols-4">
|
<div className="grid grid-cols-2 gap-3 px-[18px] pb-4 sm:grid-cols-4">
|
||||||
{classes.map((cls) => (
|
{classes.map((cls) => (
|
||||||
<div key={cls.id}>
|
<div key={cls.id}>
|
||||||
<div className="flex items-center gap-1.5">
|
<div className="flex items-center gap-1.5">
|
||||||
<span
|
<span
|
||||||
className="h-2 w-2 rounded-full shrink-0"
|
className="h-[7px] w-[7px] shrink-0 rounded-full"
|
||||||
style={{ backgroundColor: cls.color }}
|
style={{ backgroundColor: cls.color }}
|
||||||
/>
|
/>
|
||||||
<span className="text-xs font-semibold text-slate-800">{cls.name}</span>
|
<span className="text-[11px] text-[var(--project-heading)]">{cls.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-2 text-2xl font-bold tracking-tight text-slate-900">
|
<p className="mt-1.5 text-xl font-normal leading-[30px] tabular-nums text-[var(--project-heading)]">
|
||||||
{formatNum(cls.count)}
|
{formatNum(cls.count)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -53,16 +53,16 @@ export const LabelDistribution: React.FC<LabelDistributionProps> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Bottom progress bar */}
|
{/* Bottom progress bar */}
|
||||||
<div className="mt-6 pt-2">
|
<div className="px-[18px] pb-[18px]">
|
||||||
<div className="flex items-center justify-between text-xs">
|
<div className="flex items-center justify-between text-[11px]">
|
||||||
<span className="text-slate-500">
|
<span className="text-[var(--project-body)]">
|
||||||
{formatNum(annotatedImages)} / {formatNum(totalImages)} ảnh đã gán nhãn
|
{formatNum(annotatedImages)} / {formatNum(totalImages)} ảnh đã gán nhãn
|
||||||
</span>
|
</span>
|
||||||
<span className="font-bold text-indigo-600">{progressPercent}%</span>
|
<span className="font-semibold text-[var(--project-accent)]">{progressPercent}%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-slate-100">
|
<div className="mt-2 h-1.5 w-full overflow-hidden rounded-full bg-[var(--project-border)]">
|
||||||
<div
|
<div
|
||||||
className="h-full rounded-full bg-[#C95C3C] transition-all duration-300"
|
className="h-full rounded-full bg-[var(--brand-primary)] transition-[width] duration-300"
|
||||||
style={{ width: `${Math.min(100, Math.max(0, progressPercent))}%` }}
|
style={{ width: `${Math.min(100, Math.max(0, progressPercent))}%` }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,20 @@ export const MemberAssignment: React.FC<MemberAssignmentProps> = ({
|
||||||
: sortedMembers
|
: sortedMembers
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col justify-between rounded-2xl border border-slate-200/80 bg-white p-5 shadow-[0_1px_2px_rgba(15,23,42,0.03)]">
|
<div className="flex h-full flex-col justify-between overflow-hidden rounded-xl border border-[var(--project-border)] bg-[var(--project-surface)]">
|
||||||
<div>
|
<div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex h-[52px] items-center justify-between px-[18px]">
|
||||||
<h3 className="text-base font-bold text-slate-900">Phân công thành viên</h3>
|
<h3 className="text-sm font-semibold text-[var(--project-heading)]">Phân công thành viên</h3>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onEditMembers}
|
onClick={onEditMembers}
|
||||||
className="text-xs font-semibold text-indigo-600 hover:text-indigo-700 transition"
|
className="text-[11px] text-[var(--project-accent)] transition hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--project-accent)]/30"
|
||||||
>
|
>
|
||||||
Chỉnh sửa →
|
Chỉnh sửa →
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-4 space-y-3">
|
<div className="space-y-3 px-[18px] pb-4">
|
||||||
{displayMembers.map((member) => {
|
{displayMembers.map((member) => {
|
||||||
const rightLabel =
|
const rightLabel =
|
||||||
member.role === 'reviewer' && member.pendingReviewCount !== undefined
|
member.role === 'reviewer' && member.pendingReviewCount !== undefined
|
||||||
|
|
@ -50,25 +50,24 @@ export const MemberAssignment: React.FC<MemberAssignmentProps> = ({
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={member.id}
|
key={member.id}
|
||||||
className="flex items-center justify-between py-0.5"
|
className="flex min-w-0 items-center justify-between gap-3"
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex min-w-0 items-center gap-2.5">
|
||||||
<div
|
<div
|
||||||
style={{ backgroundColor: member.color }}
|
className="flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-full bg-[var(--project-avatar-background)] text-[11px] font-semibold text-[var(--project-accent)]"
|
||||||
className="flex h-8 w-8 items-center justify-center rounded-full text-xs font-bold text-indigo-700"
|
|
||||||
>
|
>
|
||||||
{member.initials}
|
{member.initials}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-baseline gap-2">
|
<div className="flex items-baseline gap-2">
|
||||||
<span className="text-xs font-bold text-slate-900">
|
<span className="truncate text-[11px] font-medium text-[var(--project-heading)]">
|
||||||
{member.name}
|
{member.name}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-xs text-slate-400">
|
<span className="truncate text-[10px] text-[var(--project-body)]">
|
||||||
{ROLE_LABELS[member.role]}
|
{ROLE_LABELS[member.role]}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-xs font-medium text-slate-600">
|
<span className="shrink-0 text-[11px] text-[var(--project-body)]">
|
||||||
{rightLabel}
|
{rightLabel}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,20 +17,20 @@ export const OverviewTab: React.FC<OverviewTabProps> = ({
|
||||||
onSwitchTab,
|
onSwitchTab,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-5">
|
||||||
{/* 4 Status Cards */}
|
{/* 4 Status Cards */}
|
||||||
<StatusCards stats={project.stats} />
|
<StatusCards stats={project.stats} />
|
||||||
|
|
||||||
{/* Side-by-side Label Distribution (7 cols) + Member Assignment (5 cols) */}
|
{/* Side-by-side label summary and member assignments. */}
|
||||||
<div className="grid grid-cols-1 gap-4 lg:grid-cols-12">
|
<div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
||||||
<div className="lg:col-span-7">
|
<div className="min-w-0">
|
||||||
<LabelDistribution
|
<LabelDistribution
|
||||||
classes={project.classes}
|
classes={project.classes}
|
||||||
stats={project.stats}
|
stats={project.stats}
|
||||||
onManageLabels={() => onSwitchTab('labels')}
|
onManageLabels={() => onSwitchTab('labels')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="lg:col-span-5">
|
<div className="min-w-0">
|
||||||
<MemberAssignment
|
<MemberAssignment
|
||||||
members={project.members}
|
members={project.members}
|
||||||
onEditMembers={() => onSwitchTab('members')}
|
onEditMembers={() => onSwitchTab('members')}
|
||||||
|
|
@ -46,6 +46,17 @@ export const OverviewTab: React.FC<OverviewTabProps> = ({
|
||||||
stats={project.stats}
|
stats={project.stats}
|
||||||
classes={project.classes}
|
classes={project.classes}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<section className="overflow-hidden rounded-xl border border-[var(--project-border)] bg-[var(--project-surface)]">
|
||||||
|
<div className="flex min-h-[52px] items-center px-[18px]">
|
||||||
|
<h2 className="text-sm font-semibold text-[var(--project-heading)]">Thông tin bộ dữ liệu</h2>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-wrap gap-x-8 gap-y-2 border-t border-[var(--project-border)] px-[18px] py-4 text-xs text-[var(--project-body)]">
|
||||||
|
<span>Mã dự án: <span className="font-mono text-[var(--project-heading)]">{project.slug}</span></span>
|
||||||
|
<span>Loại bài toán: <span className="text-[var(--project-heading)]">{project.taskType.replace('_', ' ')}</span></span>
|
||||||
|
<span>Tổng số ảnh: <span className="tabular-nums text-[var(--project-heading)]">{project.stats.totalImages.toLocaleString('vi-VN')}</span></span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,13 @@ export const StatusCards: React.FC<StatusCardsProps> = ({ stats }) => {
|
||||||
{cards.map((c) => (
|
{cards.map((c) => (
|
||||||
<div
|
<div
|
||||||
key={c.label}
|
key={c.label}
|
||||||
className="rounded-2xl border border-slate-200/80 bg-white px-5 py-4 shadow-[0_1px_2px_rgba(15,23,42,0.03)]"
|
className="flex min-w-0 flex-col gap-[5px] rounded-[10px] border border-[var(--project-border)] bg-[var(--project-surface)] p-[18px]"
|
||||||
>
|
>
|
||||||
<p className="text-xs font-medium text-slate-500">{c.label}</p>
|
<p className="text-[11px] font-normal leading-[17px] text-[var(--project-body)]">{c.label}</p>
|
||||||
<p className="mt-2 text-[28px] font-bold leading-tight tracking-tight text-slate-900">
|
<p className="text-[28px] font-normal leading-[42px] tabular-nums text-[var(--project-heading)]">
|
||||||
{c.value}
|
{c.value}
|
||||||
</p>
|
</p>
|
||||||
<p className="mt-2 text-xs text-slate-500">{c.subtext}</p>
|
<p className="text-[10px] leading-[15px] text-[var(--project-body)]">{c.subtext}</p>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,13 @@ import { Project, ImageItem, ActivityLog, CreateProjectInput, LabelClass, Projec
|
||||||
export const THUMBNAIL_CAR_SEDAN = '/assets/projects/classification.jpg'
|
export const THUMBNAIL_CAR_SEDAN = '/assets/projects/classification.jpg'
|
||||||
export const THUMBNAIL_TRAFFIC_STREET = '/assets/projects/object-detection.jpg'
|
export const THUMBNAIL_TRAFFIC_STREET = '/assets/projects/object-detection.jpg'
|
||||||
export const THUMBNAIL_STREET_SEGMENTATION = '/assets/projects/segmentation.jpg'
|
export const THUMBNAIL_STREET_SEGMENTATION = '/assets/projects/segmentation.jpg'
|
||||||
|
// Annotation label colors follow the Figma dashboard palette.
|
||||||
|
export const PROJECT_LABEL_COLORS = {
|
||||||
|
car: '#16b9c9',
|
||||||
|
motorbike: '#f5be51',
|
||||||
|
bus: '#ae7cff',
|
||||||
|
truck: '#648bf3',
|
||||||
|
} as const
|
||||||
|
|
||||||
export const INITIAL_PROJECTS: Project[] = [
|
export const INITIAL_PROJECTS: Project[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -16,10 +23,10 @@ export const INITIAL_PROJECTS: Project[] = [
|
||||||
thumbnailUrl: THUMBNAIL_CAR_SEDAN,
|
thumbnailUrl: THUMBNAIL_CAR_SEDAN,
|
||||||
updatedAt: 'Cập nhật 5 phút trước',
|
updatedAt: 'Cập nhật 5 phút trước',
|
||||||
classes: [
|
classes: [
|
||||||
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 980, shortcutKey: '1' },
|
{ id: 'cls-car', name: 'Ô tô', color: PROJECT_LABEL_COLORS.car, count: 980, shortcutKey: '1' },
|
||||||
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 1120, shortcutKey: '2' },
|
{ id: 'cls-motorbike', name: 'Xe máy', color: PROJECT_LABEL_COLORS.motorbike, count: 1120, shortcutKey: '2' },
|
||||||
{ id: 'cls-bus', name: 'Xe buýt', color: '#A855F7', count: 140, shortcutKey: '3' },
|
{ id: 'cls-bus', name: 'Xe buýt', color: PROJECT_LABEL_COLORS.bus, count: 140, shortcutKey: '3' },
|
||||||
{ id: 'cls-truck', name: 'Xe tải', color: '#3B82F6', count: 160, shortcutKey: '4' },
|
{ id: 'cls-truck', name: 'Xe tải', color: PROJECT_LABEL_COLORS.truck, count: 160, shortcutKey: '4' },
|
||||||
],
|
],
|
||||||
stats: {
|
stats: {
|
||||||
totalImages: 2400,
|
totalImages: 2400,
|
||||||
|
|
@ -45,10 +52,10 @@ export const INITIAL_PROJECTS: Project[] = [
|
||||||
thumbnailUrl: THUMBNAIL_TRAFFIC_STREET,
|
thumbnailUrl: THUMBNAIL_TRAFFIC_STREET,
|
||||||
updatedAt: 'Cập nhật 5 phút trước',
|
updatedAt: 'Cập nhật 5 phút trước',
|
||||||
classes: [
|
classes: [
|
||||||
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 1420, shortcutKey: '1' },
|
{ id: 'cls-car', name: 'Ô tô', color: PROJECT_LABEL_COLORS.car, count: 1420, shortcutKey: '1' },
|
||||||
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 1860, shortcutKey: '2' },
|
{ id: 'cls-motorbike', name: 'Xe máy', color: PROJECT_LABEL_COLORS.motorbike, count: 1860, shortcutKey: '2' },
|
||||||
{ id: 'cls-bus', name: 'Xe buýt', color: '#A855F7', count: 264, shortcutKey: '3' },
|
{ id: 'cls-bus', name: 'Xe buýt', color: PROJECT_LABEL_COLORS.bus, count: 264, shortcutKey: '3' },
|
||||||
{ id: 'cls-truck', name: 'Xe tải', color: '#3B82F6', count: 312, shortcutKey: '4' },
|
{ id: 'cls-truck', name: 'Xe tải', color: PROJECT_LABEL_COLORS.truck, count: 312, shortcutKey: '4' },
|
||||||
],
|
],
|
||||||
stats: {
|
stats: {
|
||||||
totalImages: 1280,
|
totalImages: 1280,
|
||||||
|
|
@ -75,10 +82,10 @@ export const INITIAL_PROJECTS: Project[] = [
|
||||||
thumbnailUrl: THUMBNAIL_STREET_SEGMENTATION,
|
thumbnailUrl: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
updatedAt: 'Cập nhật 5 phút trước',
|
updatedAt: 'Cập nhật 5 phút trước',
|
||||||
classes: [
|
classes: [
|
||||||
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 520, shortcutKey: '1' },
|
{ id: 'cls-car', name: 'Ô tô', color: PROJECT_LABEL_COLORS.car, count: 520, shortcutKey: '1' },
|
||||||
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 640, shortcutKey: '2' },
|
{ id: 'cls-motorbike', name: 'Xe máy', color: PROJECT_LABEL_COLORS.motorbike, count: 640, shortcutKey: '2' },
|
||||||
{ id: 'cls-bus', name: 'Xe buýt', color: '#A855F7', count: 110, shortcutKey: '3' },
|
{ id: 'cls-bus', name: 'Xe buýt', color: PROJECT_LABEL_COLORS.bus, count: 110, shortcutKey: '3' },
|
||||||
{ id: 'cls-truck', name: 'Xe tải', color: '#3B82F6', count: 145, shortcutKey: '4' },
|
{ id: 'cls-truck', name: 'Xe tải', color: PROJECT_LABEL_COLORS.truck, count: 145, shortcutKey: '4' },
|
||||||
],
|
],
|
||||||
stats: {
|
stats: {
|
||||||
totalImages: 640,
|
totalImages: 640,
|
||||||
|
|
@ -97,6 +104,112 @@ export const INITIAL_PROJECTS: Project[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
export const INITIAL_PROJECT_IMAGES: ImageItem[] = [
|
export const INITIAL_PROJECT_IMAGES: ImageItem[] = [
|
||||||
|
{
|
||||||
|
id: 'urban-img-321',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00321.jpg',
|
||||||
|
url: THUMBNAIL_CAR_SEDAN,
|
||||||
|
thumbnailUrl: THUMBNAIL_CAR_SEDAN,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'in_progress',
|
||||||
|
objectCount: 1,
|
||||||
|
assignedTo: { id: 'mem-hl', name: 'Hà Linh', role: 'annotator' },
|
||||||
|
submittedBy: 'Hà Linh',
|
||||||
|
submittedAt: '5 phút trước',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-322',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00322.jpg',
|
||||||
|
url: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
thumbnailUrl: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'pending_review',
|
||||||
|
objectCount: 4,
|
||||||
|
assignedTo: { id: 'mem-tn', name: 'Tuấn Nam', role: 'annotator' },
|
||||||
|
reviewerName: 'Minh Anh',
|
||||||
|
submittedBy: 'Tuấn Nam',
|
||||||
|
submittedAt: '10 phút trước',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-323',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00323.jpg',
|
||||||
|
url: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
|
thumbnailUrl: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'completed',
|
||||||
|
objectCount: 3,
|
||||||
|
assignedTo: { id: 'mem-hl', name: 'Hà Linh', role: 'annotator' },
|
||||||
|
reviewerName: 'Minh Anh',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-324',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00324.jpg',
|
||||||
|
url: THUMBNAIL_CAR_SEDAN,
|
||||||
|
thumbnailUrl: THUMBNAIL_CAR_SEDAN,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'unassigned',
|
||||||
|
objectCount: 0,
|
||||||
|
assignedTo: { id: 'mem-hl', name: 'Hà Linh', role: 'annotator' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-325',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00325.jpg',
|
||||||
|
url: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
thumbnailUrl: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'pending_review',
|
||||||
|
objectCount: 5,
|
||||||
|
assignedTo: { id: 'mem-tn', name: 'Tuấn Nam', role: 'annotator' },
|
||||||
|
reviewerName: 'Minh Anh',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-326',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00326.jpg',
|
||||||
|
url: THUMBNAIL_CAR_SEDAN,
|
||||||
|
thumbnailUrl: THUMBNAIL_CAR_SEDAN,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'unassigned',
|
||||||
|
objectCount: 0,
|
||||||
|
assignedTo: { id: 'mem-tn', name: 'Tuấn Nam', role: 'annotator' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-327',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00327.jpg',
|
||||||
|
url: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
|
thumbnailUrl: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'completed',
|
||||||
|
objectCount: 2,
|
||||||
|
assignedTo: { id: 'mem-hl', name: 'Hà Linh', role: 'annotator' },
|
||||||
|
reviewerName: 'Minh Anh',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'urban-img-328',
|
||||||
|
projectId: 'urban_vehicles_v2',
|
||||||
|
fileName: 'urban_vehicle_00328.jpg',
|
||||||
|
url: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
thumbnailUrl: THUMBNAIL_TRAFFIC_STREET,
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
status: 'in_progress',
|
||||||
|
objectCount: 2,
|
||||||
|
assignedTo: { id: 'mem-tn', name: 'Tuấn Nam', role: 'annotator' },
|
||||||
|
submittedBy: 'Tuấn Nam',
|
||||||
|
savedAt: '5 phút trước',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'img-321',
|
id: 'img-321',
|
||||||
projectId: 'traffic_camera_v2',
|
projectId: 'traffic_camera_v2',
|
||||||
|
|
@ -272,10 +385,10 @@ export function addProject(input: CreateProjectInput): Project {
|
||||||
: THUMBNAIL_STREET_SEGMENTATION,
|
: THUMBNAIL_STREET_SEGMENTATION,
|
||||||
updatedAt: 'Vừa tạo xong',
|
updatedAt: 'Vừa tạo xong',
|
||||||
classes: [
|
classes: [
|
||||||
{ id: 'cls-car', name: 'Ô tô', color: '#06B6D4', count: 0, shortcutKey: '1' },
|
{ id: 'cls-car', name: 'Ô tô', color: PROJECT_LABEL_COLORS.car, count: 0, shortcutKey: '1' },
|
||||||
{ id: 'cls-motorbike', name: 'Xe máy', color: '#F59E0B', count: 0, shortcutKey: '2' },
|
{ id: 'cls-motorbike', name: 'Xe máy', color: PROJECT_LABEL_COLORS.motorbike, count: 0, shortcutKey: '2' },
|
||||||
{ id: 'cls-bus', name: 'Xe buýt', color: '#A855F7', count: 0, shortcutKey: '3' },
|
{ id: 'cls-bus', name: 'Xe buýt', color: PROJECT_LABEL_COLORS.bus, count: 0, shortcutKey: '3' },
|
||||||
{ id: 'cls-truck', name: 'Xe tải', color: '#3B82F6', count: 0, shortcutKey: '4' },
|
{ id: 'cls-truck', name: 'Xe tải', color: PROJECT_LABEL_COLORS.truck, count: 0, shortcutKey: '4' },
|
||||||
],
|
],
|
||||||
stats: {
|
stats: {
|
||||||
totalImages: 0,
|
totalImages: 0,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
--brand-primary-hover: #b5492b;
|
--brand-primary-hover: #b5492b;
|
||||||
--project-accent: #5451d6;
|
--project-accent: #5451d6;
|
||||||
--project-accent-soft: #f1f3fe;
|
--project-accent-soft: #f1f3fe;
|
||||||
|
--project-accent-dot: #a29fff;
|
||||||
--project-canvas: #f5f6fa;
|
--project-canvas: #f5f6fa;
|
||||||
--project-surface: #ffffff;
|
--project-surface: #ffffff;
|
||||||
--project-heading: #172033;
|
--project-heading: #172033;
|
||||||
|
|
@ -18,17 +19,21 @@
|
||||||
--project-border: #e4e7ef;
|
--project-border: #e4e7ef;
|
||||||
--project-status-active-bg: #f5ded6;
|
--project-status-active-bg: #f5ded6;
|
||||||
--project-status-active-text: #5451d6;
|
--project-status-active-text: #5451d6;
|
||||||
|
--project-status-active-border: #f0cfc3;
|
||||||
--project-status-review-bg: #fff5df;
|
--project-status-review-bg: #fff5df;
|
||||||
--project-status-review-text: #b57916;
|
--project-status-review-text: #b57916;
|
||||||
|
--project-status-review-border: #f6e5bb;
|
||||||
--project-status-complete-bg: #e4f5ed;
|
--project-status-complete-bg: #e4f5ed;
|
||||||
--project-status-complete-text: #168262;
|
--project-status-complete-text: #168262;
|
||||||
|
--project-status-complete-border: #c9eadb;
|
||||||
--project-status-draft-bg: #eef0f4;
|
--project-status-draft-bg: #eef0f4;
|
||||||
--project-status-draft-text: #697386;
|
--project-status-draft-text: #697386;
|
||||||
|
--project-status-draft-border: #e2e5eb;
|
||||||
--project-status-review-dot: #b57916;
|
--project-status-review-dot: #b57916;
|
||||||
--project-label-car: #16b9c9;
|
--project-label-car: #16b9c9;
|
||||||
--project-label-bus: #ae7cff;
|
--project-label-bus: #ae7cff;
|
||||||
--project-label-motorbike: #10b981;
|
--project-label-motorbike: #f5be51;
|
||||||
--project-label-truck: #3b82f6;
|
--project-label-truck: #648bf3;
|
||||||
--project-avatar-background: #f5ded6;
|
--project-avatar-background: #f5ded6;
|
||||||
|
|
||||||
/* Màu chữ (Typography) */
|
/* Màu chữ (Typography) */
|
||||||
|
|
@ -55,19 +60,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-list-main {
|
.project-workspace-main {
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
overflow-y: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-list-main::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
|
||||||
.project-list-main {
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.project-workspace-main::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom thin scrollbars */
|
/* Custom thin scrollbars */
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,57 @@
|
||||||
|
import type React from 'react'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bảng màu chuẩn theo thiết kế Figma (MVP Đăng nhập & Hệ thống)
|
||||||
|
* Đặt tên tường minh theo ngữ cảnh sử dụng để dễ đọc và bảo trì.
|
||||||
|
*/
|
||||||
|
export const LOGIN_COLORS = {
|
||||||
|
// Màu thương hiệu chính
|
||||||
|
brandOrangeRed: '#c75c4a',
|
||||||
|
brandOrangeRedHover: '#b5492b',
|
||||||
|
brandAccentIndigo: '#5451d6',
|
||||||
|
|
||||||
|
// Màu nền (Backgrounds)
|
||||||
|
bgWhite: '#ffffff',
|
||||||
|
bgPreviewCard: '#f8f9fa',
|
||||||
|
|
||||||
|
// Màu chữ (Typography)
|
||||||
|
textLeftPrimary: '#141c2a', // Chữ chính cột giới thiệu bên trái
|
||||||
|
textRightPrimary: '#172033', // Chữ chính cột form đăng nhập bên phải
|
||||||
|
textSecondary: '#697386', // Chữ phụ, mô tả, ghi chú
|
||||||
|
textMuted: '#939bad', // Chữ mờ ở thanh phân cách "hoặc sử dụng email"
|
||||||
|
textOnBrand: '#ffffff', // Chữ trắng trên nền nút chính
|
||||||
|
|
||||||
|
// Màu đường viền (Borders / Outlines)
|
||||||
|
borderPreviewCard: '#3b465e', // Viền khung thẻ minh họa giao thông
|
||||||
|
borderControl: '#e4e7ef', // Viền ô nhập liệu, nút SSO, đường kẻ ngang
|
||||||
|
|
||||||
|
// Màu nhãn Bounding Box trên ảnh minh họa
|
||||||
|
boundingBox: {
|
||||||
|
carCyan: '#16b9c9', // Nhãn "Ô tô"
|
||||||
|
busPurple: '#ae7cff', // Nhãn "Xe buýt"
|
||||||
|
},
|
||||||
|
} as const
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hàm tạo style đường viền trong (inset outline) thay cho cú pháp Tailwind khó đọc
|
||||||
|
* như `[outline:1px_solid_#e4e7ef] [outline-offset:-1px]`
|
||||||
|
*/
|
||||||
|
export function createInsetOutlineStyle(
|
||||||
|
borderColor: string,
|
||||||
|
borderWidthPx: number = 1
|
||||||
|
): React.CSSProperties {
|
||||||
|
return {
|
||||||
|
outline: `${borderWidthPx}px solid ${borderColor}`,
|
||||||
|
outlineOffset: `-${borderWidthPx}px`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const themeTokens = {
|
export const themeTokens = {
|
||||||
colors: {
|
colors: {
|
||||||
brand: {
|
brand: {
|
||||||
primary: '#C95C3C',
|
primary: LOGIN_COLORS.brandOrangeRed,
|
||||||
primaryHover: '#B5492B',
|
primaryHover: LOGIN_COLORS.brandOrangeRedHover,
|
||||||
|
accent: LOGIN_COLORS.brandAccentIndigo,
|
||||||
light: '#FDF4F1',
|
light: '#FDF4F1',
|
||||||
border: '#F0AE99',
|
border: '#F0AE99',
|
||||||
},
|
},
|
||||||
|
|
@ -13,11 +62,10 @@ export const themeTokens = {
|
||||||
completed: { bg: '#DCFCE7', text: '#15803D', dot: '#22C55E' },
|
completed: { bg: '#DCFCE7', text: '#15803D', dot: '#22C55E' },
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
car: '#06B6D4', // Cyan - Ô tô
|
car: LOGIN_COLORS.boundingBox.carCyan, // Cyan - Ô tô (#16b9c9)
|
||||||
motorbike: '#F59E0B', // Amber - Xe máy
|
motorbike: '#F59E0B', // Amber - Xe máy
|
||||||
bus: '#A855F7', // Purple - Xe buýt
|
bus: LOGIN_COLORS.boundingBox.busPurple, // Purple - Xe buýt (#ae7cff)
|
||||||
truck: '#3B82F6', // Blue - Xe tải
|
truck: '#3B82F6', // Blue - Xe tải
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,74 @@
|
||||||
|
/**
|
||||||
|
* Bảng màu mặc định cho các lớp nhãn (Annotation Classes)
|
||||||
|
*/
|
||||||
|
export const DEFAULT_CLASS_COLOR = '#16B9C9'
|
||||||
|
|
||||||
export const CLASS_COLORS: string[] = [
|
export const CLASS_COLORS: string[] = [
|
||||||
'#3B82F6', // Ô tô - Blue
|
'#16B9C9', // Ô tô - Cyan (theo thiết kế Figma)
|
||||||
|
'#AE7CFF', // Xe buýt - Purple (theo thiết kế Figma)
|
||||||
'#10B981', // Xe máy - Emerald
|
'#10B981', // Xe máy - Emerald
|
||||||
'#F59E0B', // Xe buýt - Amber
|
'#F59E0B', // Xe tải - Amber
|
||||||
'#A855F7', // Xe tải - Purple
|
'#3B82F6', // Xe khách - Blue
|
||||||
'#EC4899', // Người đi bộ - Pink
|
'#EC4899', // Người đi bộ - Pink
|
||||||
'#06B6D4', // Xe đạp - Cyan
|
|
||||||
'#EF4444', // Biển báo - Red
|
'#EF4444', // Biển báo - Red
|
||||||
'#84CC16', // Đèn tín hiệu - Lime
|
'#84CC16', // Đèn tín hiệu - Lime
|
||||||
]
|
]
|
||||||
|
|
||||||
const NAMED_CLASS_COLORS: Record<string, string> = {
|
/**
|
||||||
'ô tô': '#3B82F6',
|
* Bảng ánh xạ tên nhãn tiếng Việt sang mã màu cố định
|
||||||
|
*/
|
||||||
|
export const NAMED_CLASS_COLORS: Record<string, string> = {
|
||||||
|
'ô tô': '#16B9C9',
|
||||||
|
'xe buýt': '#AE7CFF',
|
||||||
'xe máy': '#10B981',
|
'xe máy': '#10B981',
|
||||||
'xe buýt': '#F59E0B',
|
'xe tải': '#F59E0B',
|
||||||
'xe tải': '#A855F7',
|
|
||||||
'người đi bộ': '#EC4899',
|
'người đi bộ': '#EC4899',
|
||||||
'xe đạp': '#06B6D4',
|
'xe đạp': '#06B6D4',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lấy màu dựa theo số thứ tự (index) trong danh sách CLASS_COLORS.
|
||||||
|
* Tự động xoay vòng nếu số thứ tự vượt quá độ dài bảng màu.
|
||||||
|
*/
|
||||||
|
export function getColorByClassIndex(index: number): string {
|
||||||
|
const safeIndex = Math.abs(index) % CLASS_COLORS.length
|
||||||
|
return CLASS_COLORS[safeIndex] ?? DEFAULT_CLASS_COLOR
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tính mã băm (hash) dương từ chuỗi tên để chọn màu cố định cho tên nhãn bất kỳ.
|
||||||
|
*/
|
||||||
|
function calculateStringHash(text: string): number {
|
||||||
|
let hashValue = 0
|
||||||
|
for (let i = 0; i < text.length; i++) {
|
||||||
|
const charCode = text.charCodeAt(i)
|
||||||
|
hashValue = (hashValue * 31 + charCode) | 0
|
||||||
|
}
|
||||||
|
return Math.abs(hashValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lấy màu dựa theo tên lớp nhãn (ví dụ: "Ô tô", "Xe buýt").
|
||||||
|
* Nếu tên nhãn chưa được định nghĩa sẵn trong NAMED_CLASS_COLORS,
|
||||||
|
* hàm sẽ tự sinh màu cố định từ bảng CLASS_COLORS dựa trên tên nhãn.
|
||||||
|
*/
|
||||||
|
export function getColorByClassName(className: string): string {
|
||||||
|
const normalizedName = className.trim().toLowerCase()
|
||||||
|
|
||||||
|
if (NAMED_CLASS_COLORS[normalizedName]) {
|
||||||
|
return NAMED_CLASS_COLORS[normalizedName]
|
||||||
|
}
|
||||||
|
|
||||||
|
const colorIndex = calculateStringHash(normalizedName)
|
||||||
|
return getColorByClassIndex(colorIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hàm tổng hợp lấy màu cho lớp nhãn theo index (số) hoặc tên nhãn (chuỗi).
|
||||||
|
*/
|
||||||
export function getColorForClass(indexOrName: number | string): string {
|
export function getColorForClass(indexOrName: number | string): string {
|
||||||
if (typeof indexOrName === 'number') {
|
if (typeof indexOrName === 'number') {
|
||||||
const idx = Math.abs(indexOrName) % CLASS_COLORS.length
|
return getColorByClassIndex(indexOrName)
|
||||||
return CLASS_COLORS[idx] ?? '#3B82F6'
|
|
||||||
}
|
}
|
||||||
|
return getColorByClassName(indexOrName)
|
||||||
const normalized = indexOrName.trim().toLowerCase()
|
|
||||||
if (NAMED_CLASS_COLORS[normalized]) {
|
|
||||||
return NAMED_CLASS_COLORS[normalized] ?? '#3B82F6'
|
|
||||||
}
|
|
||||||
|
|
||||||
let hash = 0
|
|
||||||
for (let i = 0; i < normalized.length; i++) {
|
|
||||||
hash = normalized.charCodeAt(i) + ((hash << 5) - hash)
|
|
||||||
}
|
|
||||||
const idx = Math.abs(hash) % CLASS_COLORS.length
|
|
||||||
return CLASS_COLORS[idx] ?? '#3B82F6'
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,31 @@ export default {
|
||||||
200: '#f7cfc2',
|
200: '#f7cfc2',
|
||||||
300: '#f0ae99',
|
300: '#f0ae99',
|
||||||
400: '#e78264',
|
400: '#e78264',
|
||||||
500: '#c95c3c', // Primary terracotta/orange-red from wireframes
|
500: '#c75c4a', // Primary brand orange-red from Figma
|
||||||
600: '#b5492b',
|
600: '#b5492b',
|
||||||
700: '#973a22',
|
700: '#973a22',
|
||||||
800: '#7d3221',
|
800: '#7d3221',
|
||||||
900: '#672c1f',
|
900: '#672c1f',
|
||||||
|
accent: '#5451d6',
|
||||||
|
},
|
||||||
|
login: {
|
||||||
|
'text-left': '#141c2a',
|
||||||
|
'text-right': '#172033',
|
||||||
|
'text-secondary': '#697386',
|
||||||
|
'text-muted': '#939bad',
|
||||||
|
'text-accent': '#5451d6',
|
||||||
|
'surface-card': '#f8f9fa',
|
||||||
|
'border-card': '#3b465e',
|
||||||
|
'border-control': '#e4e7ef',
|
||||||
|
'label-car': '#16b9c9',
|
||||||
|
'label-bus': '#ae7cff',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
fontFamily: {
|
fontFamily: {
|
||||||
sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'],
|
sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'],
|
||||||
mono: ['JetBrains Mono', 'Fira Code', 'monospace'],
|
mono: ['IBM Plex Mono', 'JetBrains Mono', 'Fira Code', 'monospace'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
host: true,
|
||||||
port: 3000,
|
port: 3000,
|
||||||
|
allowedHosts: true,
|
||||||
open: true,
|
open: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||