mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-22 11:39:34 -06:00
34 lines
901 B
Zig
34 lines
901 B
Zig
pub fn Page(allocator: zx.Allocator) zx.Component {
|
|
return (
|
|
<main @allocator={allocator}>
|
|
<Button title="Submit" />
|
|
<Button title="Cancel" />
|
|
<AsyncScore index={1} label="Score" />
|
|
<AsyncScore index={2} label="Points" />
|
|
<AsyncScore index={3} label="Rating" />
|
|
</main>
|
|
);
|
|
}
|
|
|
|
const ButtonProps = struct { title: []const u8 };
|
|
fn Button(allocator: zx.Allocator, props: ButtonProps) zx.Component {
|
|
return (
|
|
<button @allocator={allocator}>
|
|
{props.title}
|
|
</button>
|
|
);
|
|
}
|
|
|
|
const AsyncScoreProps = struct { index: u64, label: []const u8 };
|
|
fn AsyncScore(allocator: zx.Allocator, props: AsyncScoreProps) zx.Component {
|
|
return (
|
|
<span @allocator={allocator}>
|
|
{props.label}
|
|
#
|
|
{props.index}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
const zx = @import("zx");
|