import 'package:flutter_riverpod/flutter_riverpod.dart';

/// 当前用户角色 Provider，默认 'admin' 方便开发测试全部视图
final currentRoleProvider = StateProvider<String>((ref) => 'admin');

/// 角色权限派生 Provider（布尔值）
final isAdminProvider = Provider<bool>((ref) => ref.watch(currentRoleProvider) == 'admin');
final isFinanceProvider = Provider<bool>((ref) => ref.watch(currentRoleProvider) == 'finance');
final isManagerProvider = Provider<bool>((ref) => ref.watch(currentRoleProvider) == 'manager');
final isEmployeeProvider = Provider<bool>((ref) => ref.watch(currentRoleProvider) == 'employee');

/// 角色列表（value -> 中文标签）
const roleOptions = [
  ('admin', '系统管理员'),
  ('finance', '财务人员'),
  ('manager', '部门经理'),
  ('employee', '普通员工'),
];
