feat: scaffold complete danable frontend architecture with all pages, layouts, stores, and 3 annotator modes
This commit is contained in:
commit
78848dd7d1
173 changed files with 18649 additions and 0 deletions
54
src/pages/annotator/components/navigator/ThumbnailStrip.tsx
Normal file
54
src/pages/annotator/components/navigator/ThumbnailStrip.tsx
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import React from 'react'
|
||||
import clsx from 'clsx'
|
||||
import { useAnnotatorStore } from '../../annotatorStore'
|
||||
|
||||
export const ThumbnailStrip: React.FC = () => {
|
||||
const images = useAnnotatorStore((s) => s.images)
|
||||
const currentImageIndex = useAnnotatorStore((s) => s.currentImageIndex)
|
||||
const selectImageByIndex = useAnnotatorStore((s) => s.selectImageByIndex)
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-6 gap-2.5 px-4 py-2.5">
|
||||
{images.map((img, index) => {
|
||||
const isActive = index === currentImageIndex
|
||||
// Shorten "urban_00124.jpg" -> "..00124.jpg" matching wireframe
|
||||
const shortName = img.fileName.replace(/^[a-z]+_/, '..')
|
||||
|
||||
return (
|
||||
<button
|
||||
key={img.id}
|
||||
type="button"
|
||||
onClick={() => selectImageByIndex(index)}
|
||||
className="group flex flex-col items-center gap-1 focus:outline-none"
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
'relative aspect-video w-full overflow-hidden rounded-lg border-2 transition-all',
|
||||
isActive
|
||||
? 'border-[#4F46E5] shadow-xs'
|
||||
: 'border-transparent opacity-85 hover:opacity-100'
|
||||
)}
|
||||
>
|
||||
<img
|
||||
src={img.thumbnailUrl}
|
||||
alt={img.fileName}
|
||||
className="h-full w-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<span
|
||||
className={clsx(
|
||||
'font-mono text-[10px] transition-colors',
|
||||
isActive
|
||||
? 'font-semibold text-[#4F46E5]'
|
||||
: 'text-slate-400 group-hover:text-slate-600'
|
||||
)}
|
||||
>
|
||||
{shortName}
|
||||
</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue