MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / ClusterRow

Function ClusterRow

ui/src/components/InboxSidebar.tsx:231–269  ·  view source on GitHub ↗

Row inside a workspace cluster — label lives in the header, so the * row shows just the push preview + time.

({
  entry, active, unread, onClick,
}: {
  entry: InboxEntry
  active: boolean
  unread: boolean
  onClick: () => void
})

Source from the content-addressed store, hash-verified

229/** Row inside a workspace cluster — label lives in the header, so the
230 * row shows just the push preview + time. */
231function ClusterRow({
232 entry, active, unread, onClick,
233}: {
234 entry: InboxEntry
235 active: boolean
236 unread: boolean
237 onClick: () => void
238}) {
239 return (
240 <div
241 role="button"
242 tabIndex={0}
243 onClick={onClick}
244 onKeyDown={(e) => {
245 if (e.key === 'Enter' || e.key === ' ') {
246 e.preventDefault()
247 onClick()
248 }
249 }}
250 className={`group relative grid min-h-11 grid-cols-[auto_minmax(0,1fr)] gap-x-1.5 gap-y-0.5 pl-3 pr-3 py-1.5 cursor-pointer transition-colors outline-none focus-visible:bg-bg-tertiary/70 ${
251 active ? 'bg-bg-tertiary' : 'hover:bg-bg-tertiary/50'
252 }`}
253 >
254 {active && (
255 <span aria-hidden className="absolute left-0 top-0 bottom-0 w-[2px] bg-accent" />
256 )}
257 <span
258 aria-hidden
259 className={`mt-[7px] shrink-0 w-1.5 h-1.5 rounded-full ${unread ? 'bg-accent' : 'bg-transparent'}`}
260 />
261 <span className={`min-w-0 truncate text-[11px] leading-5 ${unread ? 'text-text-muted' : 'text-text-muted/70'}`}>
262 {previewForEntry(entry)}
263 </span>
264 <span className="col-start-2 text-[10px] text-text-muted/50 tabular-nums">
265 {formatRelativeTime(entry.ts)}
266 </span>
267 </div>
268 )
269}
270
271// ==================== Time (flat chronological) view ====================
272

Callers

nothing calls this directly

Calls 3

previewForEntryFunction · 0.90
formatRelativeTimeFunction · 0.90
onClickFunction · 0.85

Tested by

no test coverage detected