diff --git a/src/components/Coach.jsx b/src/components/Coach.jsx index a1cf8db..fa53e63 100644 --- a/src/components/Coach.jsx +++ b/src/components/Coach.jsx @@ -8,8 +8,14 @@ const Coach = () => { const [message, setMessage] = useState(""); const [editingId, setEditingId] = useState(null); + // API URL const API_BASE_URL = import.meta.env.VITE_API_BASE_URL; + // Coaches SORTED + const sortedCoaches = coaches.sort( + (a, b) => new Date(b.createdAt) - new Date(a.createdAt) + ); + // Fetch coaches const fetchCoaches = async () => { try { @@ -154,7 +160,7 @@ const Coach = () => { {/* Coach List */}