<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><%= title %></title>
</head>
<body>
    <% if (users != null && users.length > 0) { %>
        <table>
            <thead>
                <tr>
                    <th>S.No</th>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                <% users.forEach((user, index) => { %>
                    <tr>
                        <td><%= index + 1 %></td>
                        <td><%= user.name %></td>
                        <td><%= user.email %></td>
                        <td>
                            <a href="/edit/<%= user._id %>">Update</a>
                            <a href="/delete/<%= user._id %>">Delete</a>
                        </td>
                    </tr>
                <% }) %>
            </tbody>
        </table>
        <a href="/register">Register</a>
    <% } else { %>
        <h1>No User Found</h1>
    <% } %>
</body>
</html>