{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "playback-queue",
  "title": "Playback Queue",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/playback-queue/PlaybackQueue.tsx",
      "content": "import { Children, Fragment, isValidElement, type ReactNode } from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { Ellipsis, Play } from 'lucide-react-native'\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu'\nimport { Icon } from '@/components/ui/icon'\nimport {\n  List,\n  ListItem,\n  ListItemContent,\n  ListItemDescription,\n  ListItemTitle,\n  ListSeparator,\n} from '@/components/ui/list'\nimport { Text } from '@/components/ui/text'\nimport { cn } from '@/lib/utils'\n\nexport interface PlaybackQueueProps extends ViewProps {\n  className?: string\n  /** A bounded set of upcoming rows. The queue renders inline and does not virtualize its children. */\n  children?: ReactNode\n  /** A summary of current media or the caller's player. */\n  current?: ReactNode\n  actions?: ReactNode\n  currentLabel?: string\n  upcomingLabel?: string\n  emptyMessage?: string\n}\n\n/** Shows the current media and caller-composed upcoming items. Playback and ordering stay with the caller. */\nexport function PlaybackQueue({\n  current,\n  actions,\n  currentLabel = 'Now playing',\n  upcomingLabel = 'Up next',\n  emptyMessage = 'Your queue is empty. Add something to play next.',\n  children,\n  className,\n  ...props\n}: PlaybackQueueProps) {\n  const items = Children.toArray(children)\n\n  return (\n    <View {...props} className={cn('gap-[20px]', className)}>\n      {current ? (\n        <View className=\"gap-[8px]\">\n          <Text size=\"sm\" variant=\"muted\" className=\"font-medium\">\n            {currentLabel}\n          </Text>\n          {current}\n        </View>\n      ) : null}\n      <View className=\"gap-[8px]\">\n        <Text className=\"font-semibold\">{upcomingLabel}</Text>\n        {items.length ? (\n          <List>\n            {items.map((item, index) => (\n              <Fragment key={isValidElement(item) ? item.key : index}>\n                {index > 0 ? <ListSeparator /> : null}\n                {item}\n              </Fragment>\n            ))}\n          </List>\n        ) : (\n          <Text variant=\"muted\">{emptyMessage}</Text>\n        )}\n        {actions}\n      </View>\n    </View>\n  )\n}\n\ninterface PlaybackQueueItemLabels {\n  play: string\n  playNext: string\n  moveEarlier: string\n  moveLater: string\n  remove: string\n}\n\nexport interface PlaybackQueueItemProps extends ViewProps {\n  className?: string\n  title: string\n  detail?: string\n  /** A localized duration, for example \"3:42\". */\n  duration?: string\n  artwork?: ReactNode\n  onPlay?: () => void\n  /** Place this item first in the upcoming queue. */\n  onPlayNext?: () => void\n  onMoveEarlier?: () => void\n  onMoveLater?: () => void\n  onRemove?: () => void\n  disabled?: boolean\n  /** Localized accessible name for the row's overflow menu. */\n  actionsLabel?: string\n  labels?: Partial<PlaybackQueueItemLabels>\n}\n\nexport function PlaybackQueueItem({\n  title,\n  detail,\n  duration,\n  artwork,\n  onPlay,\n  onPlayNext,\n  onMoveEarlier,\n  onMoveLater,\n  onRemove,\n  disabled = false,\n  actionsLabel,\n  labels,\n  accessibilityLabel,\n  className,\n  ...props\n}: PlaybackQueueItemProps) {\n  const hasOrderActions = onPlayNext || onMoveEarlier || onMoveLater\n\n  return (\n    <View {...props} className={cn('flex-row items-center gap-[4px] px-[4px] py-[4px]', className)}>\n      <ListItem\n        className=\"min-w-0 flex-1 rounded-md px-[8px] py-[8px]\"\n        disabled={disabled}\n        onPress={\n          onPlay\n            ? () => {\n                if (!disabled) onPlay()\n              }\n            : undefined\n        }\n        accessibilityLabel={\n          onPlay ? (accessibilityLabel ?? [title, detail, duration].filter(Boolean).join(', ')) : accessibilityLabel\n        }\n        accessibilityHint={onPlay && !disabled ? (labels?.play ?? 'Play now') : undefined}\n      >\n        {artwork ? (\n          <View accessibilityElementsHidden importantForAccessibility=\"no-hide-descendants\" aria-hidden>\n            {artwork}\n          </View>\n        ) : (\n          <View className=\"size-[40px] items-center justify-center rounded-md bg-muted\">\n            <Icon icon={Play} size={17} className=\"text-muted-foreground\" />\n          </View>\n        )}\n        <ListItemContent>\n          <ListItemTitle>{title}</ListItemTitle>\n          {detail ? <ListItemDescription>{detail}</ListItemDescription> : null}\n          {duration ? (\n            <ListItemDescription style={{ fontVariant: ['tabular-nums'] }}>{duration}</ListItemDescription>\n          ) : null}\n        </ListItemContent>\n      </ListItem>\n      {!disabled && (hasOrderActions || onRemove) ? (\n        <DropdownMenu className=\"self-center\">\n          <DropdownMenuTrigger\n            className=\"border-transparent bg-transparent px-0 py-0\"\n            accessibilityLabel={actionsLabel ?? `Queue actions for ${title}`}\n          >\n            <Icon icon={Ellipsis} size={20} />\n          </DropdownMenuTrigger>\n          <DropdownMenuContent align=\"end\">\n            {onPlayNext ? (\n              <DropdownMenuItem onPress={onPlayNext}>{labels?.playNext ?? 'Play next'}</DropdownMenuItem>\n            ) : null}\n            {onMoveEarlier ? (\n              <DropdownMenuItem onPress={onMoveEarlier}>{labels?.moveEarlier ?? 'Move earlier'}</DropdownMenuItem>\n            ) : null}\n            {onMoveLater ? (\n              <DropdownMenuItem onPress={onMoveLater}>{labels?.moveLater ?? 'Move later'}</DropdownMenuItem>\n            ) : null}\n            {hasOrderActions && onRemove ? <DropdownMenuSeparator /> : null}\n            {onRemove ? (\n              <DropdownMenuItem onPress={onRemove}>{labels?.remove ?? 'Remove from queue'}</DropdownMenuItem>\n            ) : null}\n          </DropdownMenuContent>\n        </DropdownMenu>\n      ) : null}\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/playback-queue/PlaybackQueue.tsx"
    },
    {
      "path": "packages/registry-native/blocks/playback-queue/index.ts",
      "content": "export { PlaybackQueue, PlaybackQueueItem, type PlaybackQueueItemProps, type PlaybackQueueProps } from './PlaybackQueue'\n",
      "type": "registry:block",
      "target": "~/components/blocks/playback-queue/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react-native"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/dropdown-menu.json",
    "https://native.uipkge.dev/r/native/icon.json",
    "https://native.uipkge.dev/r/native/list.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Playback queue with caller-composed media rows, current media, and visible reorder and remove controls.",
  "categories": [
    "media"
  ]
}