mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-22 11:39:34 -06:00
34 lines
871 B
Zig
34 lines
871 B
Zig
pub fn Page(allocator: zx.Allocator) zx.Component {
|
|
return (
|
|
<main @allocator={allocator}>
|
|
<Wrapper>
|
|
<p>Wrapped content</p>
|
|
</Wrapper>
|
|
<Container>
|
|
<span>First</span>
|
|
<span>Second</span>
|
|
</Container>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
const WrapperProps = struct { children: zx.Component };
|
|
fn Wrapper(allocator: zx.Allocator, props: WrapperProps) zx.Component {
|
|
return (
|
|
<div @allocator={allocator} class="wrapper">
|
|
{props.children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
const ContainerProps = struct { children: zx.Component };
|
|
fn Container(allocator: zx.Allocator, props: ContainerProps) zx.Component {
|
|
return (
|
|
<section @allocator={allocator} class="container">
|
|
{props.children}
|
|
</section>
|
|
);
|
|
}
|
|
|
|
const zx = @import("zx");
|