docs: fix missing allocator

This commit is contained in:
Nurul Huda (Apon) 2026-06-13 01:07:19 +06:00
parent a374b6569e
commit 145618d9ba
No known key found for this signature in database
GPG Key ID: 5D3F1DE2855A2F79
3 changed files with 5 additions and 3 deletions

View File

@ -91,7 +91,7 @@ fn EntryRow(allocator: zx.Allocator, props: EntryRowProps) zx.Component {
const indent = std.fmt.allocPrint(allocator, "padding-left: {d}rem", .{props.depth * 1}) catch "padding-left: 0";
return (
<>
<fragment @allocator={allocator}>
<div class="project-tree-row" style={indent} @allocator={allocator}>
<span class={if (is_folder) "project-tree-folder" else "project-tree-file"} translate="no">
{if (is_folder) (<FolderIcon />) else (<FileIcon name={entry.name} />)}
@ -104,7 +104,7 @@ fn EntryRow(allocator: zx.Allocator, props: EntryRowProps) zx.Component {
{if (entry.children) |children| (
renderChildren(allocator, children, props.depth + 1, props.show_descriptions)
)}
</>
</fragment>
);
}

View File

@ -69,7 +69,7 @@ pub fn TaskList(ctx: *zx.ComponentCtx(struct { tasks: []const Task })) zx.Compon
tasks_state = ctx.state([]const Task, ctx.props.tasks);
zx.log.info("Tasks: {any}\n", .{ctx.props.tasks});
return (
<tbody>
<tbody @allocator={ctx.allocator}>
{for (tasks_state.get()) |task| (
<TaskRow key={task.id} task={task} />
)}

View File

@ -247,6 +247,8 @@ fn genIntrospectRoot(
}
fn findZxInPath(b: *std.Build, expected_version: []const u8) ?[]const u8 {
// TODO: disable for now, always use from source
if (true) return null;
const zx_path = b.findProgram(&.{"zx"}, &.{}) catch return null;
var exit_code: u8 = undefined;
const stdout = b.runAllowFail(&.{ zx_path, "version" }, &exit_code, .ignore) catch return null;