@@ -7,9 +7,12 @@ import { ExecutionStatusIcon, getExecutionStatusTagColor } from "@/components/Ex
77import { InlineAvatar } from "@/components/InlineAvatar" ;
88import { Key , KeyValue , Value } from "@/components/KeyValue" ;
99import { useArtifactVersion } from "@/data/artifact-versions/artifact-version-detail-query" ;
10+ import { componentQueries } from "@/data/components" ;
1011import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query" ;
1112import { useStepDetail } from "@/data/steps/step-detail-query" ;
13+ import { getArtifactVersionSnippet } from "@/lib/code-snippets" ;
1214import { routes } from "@/router/routes" ;
15+ import { useQuery } from "@tanstack/react-query" ;
1316import {
1417 Skeleton ,
1518 Tag ,
@@ -21,8 +24,6 @@ import {
2124import { Link } from "react-router-dom" ;
2225import { Codesnippet } from "../../CodeSnippet" ;
2326import { CollapsibleCard } from "../../CollapsibleCard" ;
24- import { useQuery } from "@tanstack/react-query" ;
25- import { componentQueries } from "../../../data/components" ;
2627
2728type Props = {
2829 artifactVersionId : string ;
@@ -251,16 +252,14 @@ export function DataCard({ artifactVersionId }: Props) {
251252}
252253
253254export function CodeCard ( { artifactVersionId } : Props ) {
254- function returnConfigSchema ( id : string ) {
255- return `from zenml.client import Client
256-
257- step = Client().get_run_step(${ id } )
258- config = step.config` ;
259- }
260-
261255 return (
262256 < CollapsibleCard initialOpen title = "Code" >
263- < Codesnippet fullWidth highlightCode wrap code = { returnConfigSchema ( artifactVersionId ) } />
257+ < Codesnippet
258+ fullWidth
259+ highlightCode
260+ wrap
261+ code = { getArtifactVersionSnippet ( artifactVersionId ) }
262+ />
264263 </ CollapsibleCard >
265264 ) ;
266265}
0 commit comments