Files
LogiFlow/fix-imports.sh
T
michaelschal c0e1b26599 Replace UI components to fix critical production errors
Refactor `BLReconciliation.tsx` and multiple Shadcn/ui components by replacing them with custom, robust alternatives to resolve React #310 errors in production.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/rmaxwaw
2025-08-12 11:05:49 +00:00

27 lines
882 B
Bash
Executable File

#!/bin/bash
# Liste des hooks React à importer
HOOKS="forwardRef useState useEffect useContext useCallback useMemo useId createContext useRef"
for file in client/src/components/ui/*.tsx; do
# Vérifier si le fichier contient des hooks
hooks_needed=""
for hook in $HOOKS; do
if grep -q "\\b$hook\\b" "$file"; then
if [ -z "$hooks_needed" ]; then
hooks_needed="$hook"
else
hooks_needed="$hooks_needed, $hook"
fi
fi
done
# Si des hooks sont nécessaires, mettre à jour l'import
if [ ! -z "$hooks_needed" ]; then
if grep -q "import React from \"react\"" "$file"; then
sed -i.tmp "s/import React from \"react\"/import React, { $hooks_needed } from \"react\"/" "$file"
echo "Updated $file with hooks: $hooks_needed"
fi
fi
done