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

namespace InABox.Mobile
{
    public class MobileDocumentCameraSource : MobileImageSource<MobileDocumentCameraSource, MobileDocumentCameraOptions>
    {
        public MobileDocumentCameraSource(MobileDocumentCameraOptions options) : base(options)
        {
        }
        
        protected override async Task<bool> IsEnabled() 
            => await IsEnabled<Permissions.Camera>();
        
        protected override async Task<FileResult> Capture() 
            => await MobileUtils.ImageTools.CapturePhotoAsync(Options.Compression, Options.Constraints);


    }
}