import 'package:flutter/material.dart';

enum OrderType {
  dineIn('DINE IN'),
  takeAway('TAKE AWAY'),
  delivery('DELIVERY'),
  freeTable('FREE TABLE');

  final String value;
  const OrderType(this.value);

  static OrderType fromString(String value) {
    return OrderType.values.firstWhere(
      (type) => type.value == value,
      orElse: () => OrderType.dineIn,
    );
  }

  IconData get icon {
    switch (this) {
      case OrderType.dineIn:
        return Icons.dinner_dining_outlined;
      case OrderType.takeAway:
        return Icons.takeout_dining_outlined;
      case OrderType.delivery:
        return Icons.delivery_dining_outlined;
      case OrderType.freeTable:
        return Icons.table_bar_outlined;
    }
  }
}
