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

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

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