using AntDesign;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using wispro.sp.entity;
using wispro.sp.web.Services;

namespace wispro.sp.web.Components
{
    public partial class SubmitWorkContent
    {
        ProjectContentRecord _Model;
        private IFeedbackRef feedbackRef;
        
        [Inject] IUserService _UserService { get; set; }

        List<Staff> Staffs;
        
        protected override async void OnInitialized()
        {
            _Model = base.Options ?? new ProjectContentRecord();
            
            if (_Model.ReviewerId.HasValue && _Model.Reviewer == null)
            {
                _Model.Reviewer = await _UserService.GetUser(_Model.ReviewerId.Value);
            }

            Staffs = await _UserService.GetAll();

            base.OnInitialized();
            feedbackRef = base.FeedbackRef;
            StateHasChanged();
        }
        
    }
}
