using System.Threading.Tasks;
using Xamarin.Essentials;

namespace InABox.Mobile
{
    public class MobileDocumentPhotoLibrarySource : MobileImageSource<MobileDocumentPhotoLibrarySource, MobileDocumentPhotoLibraryOptions>
    {
        
        public MobileDocumentPhotoLibrarySource(MobileDocumentPhotoLibraryOptions options) : base(options)
        {
        }
        
        protected override async Task<bool> IsEnabled()
            => await IsEnabled<Permissions.Photos>();

        protected override async Task<FileResult> Capture() 
            => await MobileUtils.ImageTools.PickPhotoAsync(Options.Compression, Options.Constraints);
        
    }
}