Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

782 B
Raw Blame
import { createContext, type ReactNode } from "react";
import { View } from "react-native";

import { Checkbox } from "@/components/ui";

export const TaskItemCheckedContext = createContext(false);

export function MarkdownTaskItem({
  checked,
  children,
}: {
  checked: boolean;
  children: ReactNode;
}) {
  return (
    <View
      style={{
        flexDirection: "row",
        alignItems: "flex-start",
        gap: 8,
        marginVertical: 3,
      }}
    >
      <View style={{ paddingTop: 2 }} pointerEvents="none">
        <Checkbox checked={checked} />
      </View>
      <View style={{ flex: 1, minWidth: 0 }}>
        <TaskItemCheckedContext.Provider value={checked}>
          {children}
        </TaskItemCheckedContext.Provider>
      </View>
    </View>
  );
}