Server-safe shared utilities for the video-bites surface, providing a title constant, profile adapter, and sort comparator that can be imported in server-side contexts without pulling in client-only dependencies. ## Key Components | Export | Type | Description | |---|---|---| | `DEFAULT_VIDEO_BITES_TITLE` | `const` | Canonical section title string (`'Key Moments'`) | | `VideoBiteStripProfile` | `interface` | Profile shape rendered in the strip's hover overlay | | `toStripProfile()` | function | Adapter that maps repo-wide author/user rows to `VideoBiteStripProfile` | | `sortBitesByCreatedAtDesc()` | function | Null-safe `created_at`-descending comparator for `VideoTeaser` arrays | ## Usage Example ```typescript import { DEFAULT_VIDEO_BITES_TITLE, toStripProfile, sortBitesByCreatedAtDesc, } from '@flamingo-stack/openframe-frontend-core/components/features/video-bites-shared' // Section title console.log(DEFAULT_VIDEO_BITES_TITLE) // 'Key Moments' // Map an author row → strip profile (returns null when full_name is absent) const profile = toStripProfile( { full_name: 'Ada Lovelace', avatar_url: '/avatars/ada.jpg', job_title: 'Engineer' }, 'Contributor', // fallback subtitle ) // → { name: 'Ada Lovelace', avatarUrl: '/avatars/ada.jpg', subtitle: 'Engineer' } const profile2 = toStripProfile(null) // → null // Sort bites newest-first; missing created_at sorts last const sorted = [...videoBites].sort(sortBitesByCreatedAtDesc) ``` ## Notes - **Server-safe by design** — no React imports, no `'use client'` directive. Mirrors the same isolation pattern as `mux-origins.ts`. - `toStripProfile` returns `null` (never `{ name: '' }`) when `full_name` is absent, enabling safe `profile ?? fallback` chains at call sites. - Client components (``, the features barrel) re-export from this file — definitions must never be duplicated. **Source:** [`video-bites-shared.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/video-bites-shared.ts)