fix: client side refresh for component
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import { RunOutputs } from "@/components/RunOutputs";
|
||||
import { db } from "@/db/db";
|
||||
import { workflowRunOutputs } from "@/db/schema";
|
||||
import { eq } from "drizzle-orm";
|
||||
|
||||
// export async function getRunsOutputDisplay(run_id: string) {
|
||||
// return <RunOutputs run_id={run_id} />;
|
||||
// }
|
||||
|
||||
export async function getRunsOutput(run_id: string) {
|
||||
// throw new Error("Not implemented");
|
||||
return await db
|
||||
.select()
|
||||
.from(workflowRunOutputs)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
"use server";
|
||||
|
||||
import type { StringLiteralUnion } from "shikiji";
|
||||
import { getHighlighter } from "shikiji";
|
||||
|
||||
export async function highlight(
|
||||
code: string,
|
||||
lang: StringLiteralUnion<string>,
|
||||
) {
|
||||
const highlighter = await getHighlighter({
|
||||
themes: ["one-dark-pro"],
|
||||
langs: [lang],
|
||||
});
|
||||
return highlighter.codeToHtml(code.trim(), {
|
||||
lang: lang,
|
||||
theme: "one-dark-pro",
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user