import type { MediaItem } from '@/types/media';

export function getFirstCoverImage(
    items: Array<{ images?: MediaItem[] }>,
): MediaItem | undefined {
    for (const item of items) {
        if (item.images?.length) {
            return item.images[0];
        }
    }

    return undefined;
}
