Export template source from 099bb9f5d64bce50b20b6cb51d5333f009b8d418:quixos-instance/packages/todo-react-runtime
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import componentSource from "./todo-component.js?browser-source";
|
||||
import type { Contexts } from "./gen/qx.js";
|
||||
|
||||
export const source = () => componentSource;
|
||||
export const createComponent = ({ objectId }: Contexts["createComponent"]) => objectId;
|
||||
export const props = { kind: "derived" as const, get: async ({ objectId, ports }: Contexts["propsGet"]): Promise<Record<string, unknown>> => {
|
||||
const [title, status, priority, titleLive, statusLive, priorityLive, notesLive, dueDateLive, energyLive] = await Promise.all([
|
||||
ports.data["title.get"](), ports.data["status.get"](), ports.data["priority.get"](),
|
||||
ports.data.live["title.get"](), ports.data.live["status.get"](), ports.data.live["priority.get"](),
|
||||
ports.data.live["notes.get"](), ports.data.live["dueDate.get"](), ports.data.live["energy.get"](),
|
||||
]);
|
||||
const priorityText = priority && priority !== "NORMAL" ? ` ${priority.toLowerCase()}` : "";
|
||||
return {
|
||||
task_id: ports.data.objectId, component_id: objectId, title: titleLive, status: statusLive,
|
||||
priority: priorityLive, notes: notesLive, due_date: dueDateLive, energy: energyLive,
|
||||
display_label: `[${status || "OPEN"}]${priorityText} ${title || "Untitled task"}`,
|
||||
};
|
||||
}};
|
||||
export const stopWatch = () => null;
|
||||
Reference in New Issue
Block a user