mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
refactor(utils): update getPath function to use EditorLanguageConfig from Prisma
This commit is contained in:
parent
4d13ba2c6d
commit
c1999bd386
@ -1,13 +1,11 @@
|
|||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
import { clsx, type ClassValue } from "clsx";
|
import { clsx, type ClassValue } from "clsx";
|
||||||
import { EditorLanguage } from "@prisma/client";
|
import { EditorLanguageConfig } from "@prisma/client";
|
||||||
import LanguageServerConfig from "@/config/language-server";
|
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs))
|
return twMerge(clsx(inputs))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPath(lang: EditorLanguage) {
|
export function getPath(editorLanguageConfig: EditorLanguageConfig) {
|
||||||
const config = LanguageServerConfig[lang];
|
return `file:///${editorLanguageConfig.language}${editorLanguageConfig.fileExtension}`;
|
||||||
return `file:///${config.lang.fileName}${config.lang.fileExtension}`;
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user