import 'package:flutter/material.dart';

/// Curated list of ~25 household Material Icons for the room icon picker.
const List<({String name, IconData icon})> curatedRoomIcons = [
  (name: 'kitchen', icon: Icons.kitchen),
  (name: 'bathtub', icon: Icons.bathtub),
  (name: 'bed', icon: Icons.bed),
  (name: 'living', icon: Icons.living),
  (name: 'weekend', icon: Icons.weekend),
  (name: 'door_front', icon: Icons.door_front_door),
  (name: 'desk', icon: Icons.desk),
  (name: 'garage', icon: Icons.garage),
  (name: 'balcony', icon: Icons.balcony),
  (name: 'local_laundry', icon: Icons.local_laundry_service),
  (name: 'stairs', icon: Icons.stairs),
  (name: 'child_care', icon: Icons.child_care),
  (name: 'single_bed', icon: Icons.single_bed),
  (name: 'dining', icon: Icons.dining),
  (name: 'yard', icon: Icons.yard),
  (name: 'grass', icon: Icons.grass),
  (name: 'home', icon: Icons.home),
  (name: 'storage', icon: Icons.inventory_2),
  (name: 'window', icon: Icons.window),
  (name: 'cleaning', icon: Icons.cleaning_services),
  (name: 'iron', icon: Icons.iron),
  (name: 'microwave', icon: Icons.microwave),
  (name: 'shower', icon: Icons.shower),
  (name: 'chair', icon: Icons.chair),
  (name: 'door_sliding', icon: Icons.door_sliding),
];

/// Map a stored icon name string back to its IconData.
///
/// Returns [Icons.home] as fallback if the name is not found.
IconData mapIconName(String name) {
  for (final entry in curatedRoomIcons) {
    if (entry.name == name) return entry.icon;
  }
  return Icons.home;
}
