diff --git a/frontend/components/content/step-list.tsx b/frontend/components/content/step-list.tsx index a88e4844..0999859a 100644 --- a/frontend/components/content/step-list.tsx +++ b/frontend/components/content/step-list.tsx @@ -1,101 +1,83 @@ -import Link from "next/link"; +import Link from 'next/link'; export type StepContent = - | string - | { - type?: "text" | "image" | "video"; - content: string; - alt?: string; - caption?: string; - link?: string; - }; + | string + | { + type?: 'text' | 'image' | 'video'; + content: string; + alt?: string; + caption?: string; + link?: string; + }; export const StepList = ({ steps }: { steps: StepContent[] }) => { - const renderStepContent = (step: StepContent) => { - const wrapWithLink = (content: React.ReactNode, link?: string) => { - if (link) { - return ( - - {content} - - ); - } - return content; - }; + const renderStepContent = (step: StepContent) => { + const wrapWithLink = (content: React.ReactNode, link?: string) => { + if (link) { + return ( + + {content} + + ); + } + return content; + }; - if (typeof step === "string") { - return wrapWithLink(
{step}
); - } + if (typeof step === 'string') { + return wrapWithLink({step}
); + } - const contentType = step.type || "text"; + const contentType = step.type || 'text'; - switch (contentType) { - case "text": - return wrapWithLink({step.content}
, step.link); + switch (contentType) { + case 'text': + return wrapWithLink({step.content}
, step.link); - case "image": - return wrapWithLink( -{step.caption}
} -{step.caption}
} +{step.caption}
- )} -{step.caption}
} +