import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/provider/accounts/employees.dart';

import 'package:pweb/widgets/employee/avatar/widget.dart';


class EmployeeAvatarProvider extends StatelessWidget {
  final String? employeeRef;
  final double? radius;

  const EmployeeAvatarProvider({
    super.key, 
    this.employeeRef,
    this.radius,
  });

  @override
  Widget build(BuildContext context) => Consumer<EmployeesProvider>(builder: (context, provider, _) => EmployeeAvatar(
    radius: radius,
    avatarUrl: provider.getEmployee(employeeRef)?.avatarUrl,
    employeeName: provider.getEmployee(employeeRef)?.name ?? '',
  ));
}