using ExcelTableImporter.Models.ExcelModels;

namespace ExcelTableImporter.Commands;

public class CommandHandlerFactory(AnimeLibrary library)
{
    public ICommandHandler? GetHandler(ICommand command)
    {
        return command switch
        {
            ExitCommand exitCommand => new ExitCommandHandler(library, exitCommand),
            ListCommand listCommand => new ListCommandHandler(library, listCommand),
            _ => null
        };
    }
}