'use client'; import { ChevronDown, ChevronRight, Pin, PinOff } from 'lucide-react'; import { PIN_GROUP_SUFFIX } from '@/utils/preferences'; /** * Collapsible header row for a lexicon group (a major `app.bsky` block or a * nested `app.bsky.feed` sub-group) in the collections list. Shows the group * prefix with a `.*` suffix, a member count, and — when pinnable — a * pin/unpin button that pins the whole `prefix.*` group. Purely presentational; * owns the open/pinned state and the toggle handlers. */ export default function GroupHeader({ open, onToggle, prefix, dimPrefix, count, emphasize, indent, pinnable, pinned, onTogglePin, }: { open: boolean; onToggle: () => void; prefix: string; /** Leading slice of `prefix` to render dimmed because it's inherited from a parent group. */ dimPrefix?: string; count: number; emphasize?: boolean; indent?: boolean; /** Show the pin/unpin button that pins the whole `prefix.*` group. */ pinnable?: boolean; pinned?: boolean; onTogglePin?: () => void; }) { const hasDim = dimPrefix && prefix.startsWith(dimPrefix); const dim = hasDim ? dimPrefix : ''; const tail = hasDim ? prefix.slice(dimPrefix.length) : prefix; const groupNsid = `${prefix}${PIN_GROUP_SUFFIX}`; return (
{pinnable && onTogglePin && ( )}
); }