user-management.component.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <div class="management-container">
  2. <header>
  3. <button class="back-btn" routerLink="/dashboard">
  4. <lucide-icon [name]="ArrowLeft" class="icon-small"></lucide-icon> Back to Dashboard
  5. </button>
  6. <h1>User Management</h1>
  7. <p>Manage employee medical allowances and profiles</p>
  8. </header>
  9. <div class="management-grid">
  10. <!-- Creation Form -->
  11. <div class="card form-card">
  12. <h2>Add New Employee</h2>
  13. <form [formGroup]="userForm" (ngSubmit)="onSubmit()">
  14. <div class="form-field">
  15. <label for="name">Full Name</label>
  16. <input id="name" type="text" formControlName="name" placeholder="E.g. John Doe">
  17. </div>
  18. <div class="form-field">
  19. <label for="department">Department</label>
  20. <input id="department" type="text" formControlName="department" placeholder="E.g. Engineering">
  21. </div>
  22. <div class="form-field">
  23. <label for="medical_allowance">Annual Allowance (MYR)</label>
  24. <input id="medical_allowance" type="number" formControlName="medical_allowance">
  25. </div>
  26. <button type="submit" [disabled]="!userForm.valid || isLoading" class="submit-btn text-white">
  27. <lucide-icon [name]="UserPlus" class="icon-small"></lucide-icon>
  28. {{ isLoading ? 'Creating...' : 'Create Profile' }}
  29. </button>
  30. </form>
  31. </div>
  32. <!-- User List -->
  33. <div class="card list-card">
  34. <h2>Employee Directory</h2>
  35. <div class="user-list">
  36. <div *ngIf="isLoading && users.length === 0" class="loading">Loading directory...</div>
  37. <div *ngFor="let user of users" class="user-item">
  38. <div class="user-info">
  39. <div class="user-avatar-small">{{ user.name[0] }}</div>
  40. <div>
  41. <h3>{{ user.name }}</h3>
  42. <p>{{ user.department }}</p>
  43. </div>
  44. </div>
  45. <div class="user-balance">
  46. <span class="label">Balance</span>
  47. <span class="value">RM {{ user.medical_allowance | number:'1.2-2' }}</span>
  48. </div>
  49. </div>
  50. <div *ngIf="!isLoading && users.length === 0" class="empty-state">No employees registered yet.</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>