Fix web typecheck errors across core feature modules

This commit is contained in:
zouantchaw
2026-02-13 10:08:41 -05:00
parent 6502a2f983
commit 85532e96ac
16 changed files with 34 additions and 212 deletions

View File

@@ -164,7 +164,8 @@ export default function AddStaff() {
<Checkbox
id={skill}
checked={field.value?.includes(skill)}
onCheckedChange={(checked) => {
onChange={(e) => {
const checked = e.target.checked;
const updatedSkills = checked
? [...(field.value || []), skill]
: field.value?.filter((s: string) => s !== skill);

View File

@@ -18,7 +18,7 @@ const ITEMS_PER_PAGE = 10;
function StaffActiveStatus({ staffId }: { staffId: string }) {
const { data: staffDetail, isLoading } = useGetStaffById(dataConnect, { id: staffId });
const getLastActiveText = (lastActive?: string) => {
const getLastActiveText = (lastActive?: string | null) => {
if (!lastActive) return 'Never';
try {
const date = new Date(lastActive);

View File

@@ -74,7 +74,7 @@ export default function EmployeeCard({ staff }: EmployeeCardProps) {
const coveragePercentage = staff.shift_coverage_percentage || 0;
const cancellationCount = staff.cancellation_count || 0;
const noShowCount = staff.no_show_count || 0;
const rating = staff.rating || 0;
const rating = staff.averageRating || 0;
const reliabilityScore = staff.reliability_score || 0;
const reliability = getReliabilityColor(reliabilityScore);

View File

@@ -107,7 +107,7 @@ export default function DocumentVault() {
const filteredStaff = useMemo(() => {
let result = [...staff];
if (isVendor && user?.uid) {
result = result.filter(s => s.ownerId === user.uid || s.createdBy === user.email);
result = result.filter(s => s.ownerId === user.uid);
}
if (searchTerm) {
result = result.filter(s =>
@@ -472,7 +472,7 @@ export default function DocumentVault() {
<thead>
<tr className="border-b border-gray-100">
<th className="text-left py-6 px-8 font-bold text-gray-400 text-[10px] uppercase tracking-wider min-w-[280px]">Employees</th>
{availableDocTypes.map((type, idx) => (
{availableDocTypes.map((type) => (
<th key={type.documentType} className="p-4 min-w-[160px]">
<div className="flex flex-col items-center gap-2">
<span className="font-bold text-gray-600 text-[10px] uppercase tracking-wider">{type.name}</span>