feat: update instructions convert

This commit is contained in:
clean99 2023-11-24 11:10:51 +08:00
parent ab7d2d332a
commit 6a06d890aa

View File

@ -1,6 +1,12 @@
import { Instruction } from "@/types";
import { type ClassValue, clsx } from "clsx" import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge" import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)) 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");