import { ucFirstAllSnakeToPascalWithSpaces } from "core/utils"; import { useRef } from "react"; import { TbTrash } from "react-icons/tb"; import { useFlows } from "../../client/schema/flows/use-flows"; import { Button } from "../../components/buttons/Button"; import { CellValue, DataTable } from "../../components/table/DataTable"; import * as AppShell from "../../layouts/AppShell/AppShell"; import { routes, useNavigate } from "../../lib/routes"; import { FlowCreateModal, type TCreateFlowModalSchema } from "./components/FlowCreateModal"; export function FlowsList() { const createModalRef = useRef(null); const [navigate] = useNavigate(); const { flows } = useFlows(); console.log("flows", flows); const data = flows.map((flow) => ({ flow: flow.name, trigger: flow.trigger.type, mode: flow.trigger.config.mode, tasks: Object.keys(flow.tasks).length, start_task: flow.startTask?.name })); function handleClick(row) { navigate(routes.flows.flows.edit(row.flow)); } return ( <> createModalRef.current?.open()}> Create new } > All Flows
); } const renderValue = ({ value, property }) => { if (["is_default", "implicit_allow"].includes(property)) { return value ? Yes : No; } if (property === "permissions") { return [...(value || [])].map((p, i) => ( {p} )); } return ; };