diff --git a/src/frontend/src/components/cardComponent/index.tsx b/src/frontend/src/components/cardComponent/index.tsx index ac85926d5..e73ead557 100644 --- a/src/frontend/src/components/cardComponent/index.tsx +++ b/src/frontend/src/components/cardComponent/index.tsx @@ -7,7 +7,9 @@ import useFlowStore from "../../stores/flowStore"; import useFlowsManagerStore from "../../stores/flowsManagerStore"; import { useStoreStore } from "../../stores/storeStore"; import { storeComponent } from "../../types/store"; -import cloneFLowWithParent from "../../utils/storeUtils"; +import cloneFLowWithParent, { + getInputsAndOutputs, +} from "../../utils/storeUtils"; import { cn, convertTestName } from "../../utils/utils"; import IconComponent from "../genericIconComponent"; import ShadTooltip from "../shadTooltipComponent"; @@ -20,6 +22,7 @@ import { CardTitle, } from "../ui/card"; import Loading from "../ui/loading"; +import { FlowType } from "../../types/flow"; export default function CollectionCardComponent({ data, @@ -74,6 +77,15 @@ export default function CollectionCardComponent({ return newFlow; } + function hasPlayground(flow?: FlowType) { + if (!flow) { + return false; + } + const { inputs, outputs } = getInputsAndOutputs(flow?.data?.nodes ?? []); + console.log(inputs, outputs); + return inputs.length > 0 || outputs.length > 0; + } + useEffect(() => { if (currentFlowId && playground) { if (openPlayground) { @@ -296,7 +308,7 @@ export default function CollectionCardComponent({
{playground && data?.metadata !== undefined ? (