/**
 * TrackImageViewDataBuilder
 *
 * Transforms MediaBinaryDTO into TrackImageViewData for server-side rendering.
 * Deterministic; side-effect free; no HTTP calls.
 */

import { MediaBinaryDTO } from '@/lib/types/MediaBinaryDTO';
import { TrackImageViewData } from '@/lib/view-data/TrackImageViewData';

export class TrackImageViewDataBuilder {
  static build(apiDto: MediaBinaryDTO): TrackImageViewData {
    return {
      buffer: Buffer.from(apiDto.buffer).toString('base64'),
      contentType: apiDto.contentType,
    };
  }
}