diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index ec79801..c6010cb 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -1,6 +1,12 @@ +import { Instruction } from "@/types"; import { type ClassValue, clsx } from "clsx" import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } + +export const handleInstructions = (instructions: string): string => + (JSON.parse(instructions) || []).map((line: Instruction) => + `- ${line.element} in the ${line.location} has a mistake: ${line.mistake}, please update: ${line.improvement}.`).join("\n\n"); +