pub fn Page(ctx: zx.PageContext) zx.Component {
    const allocator = ctx.arena;

    return (
        <div @{allocator}>
            <form onsubmit={handleSubmit}>
                <label>Username: <input type="text" name="username" required /></label>
                <input type="submit" name="action" value="Login" />
            </form>
        </div>
    );
}

// this should get added to server action registry maybe inside meta.zig as a list of functions, and when rendered on the client side the event handler is replaced with a stub that makes fetch call to the current page endpoint
// with autogenerated action id like we generate component id, the server than finds the actual server action and invokes it with the event data, and returns the result to the client
pub fn handleSubmit(ctx: zx.EventContext) void {
   _ = ctx;
}

const zx = @import("zx");
const std = @import("std");
