'use client';

/** Audio block — thin chat wrapper around `AudioPlayer`. */

import { LazyPlayer } from '../../../../media/AudioPlayer/lazy';
import type { AudioBlock } from '../../../types/block';
import type { BlockRendererProps } from './types';

export default function AudioBlockRenderer({ block, ctx }: BlockRendererProps<AudioBlock>) {
  const variant = block.variant ?? (ctx.appearance === 'compact' ? 'compact' : 'default');
  return (
    <LazyPlayer
      src={block.src}
      title={block.title}
      artist={block.artist}
      cover={block.cover}
      variant={variant}
    />
  );
}
