+ {items.length === 0 ? (
+
Error FIX IT
+ ) : (
+ /*Only the top 5 distinct based on title*/
+ items.slice(0, 5).map((item, i) => (
+
void clickedItem(item)}
+ role="button"
+ tabIndex={0}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ if (e.key === ' ') {
+ e.preventDefault();
+ }
+ void clickedItem(item);
+ }
+ }}
+ >
+
{item.data[0].title}
+
+ ))
+ )}
+
+ );
+}
+
+function getDistinctItemsByTitle(items: NasaImageAndVideoLibraryItemType[]): NasaImageAndVideoLibraryItemType[] {
+ const titleMap = new Map