mirror of
				https://github.com/cfngc4594/monaco-editor-lsp-next.git
				synced 2025-10-30 20:53:33 +00:00 
			
		
		
		
	feat(utils): add difficulty color utility and update type imports
This commit is contained in:
		
							parent
							
								
									192d882fdd
								
							
						
					
					
						commit
						25920fcb68
					
				| @ -1,6 +1,6 @@ | |||||||
| import { twMerge } from "tailwind-merge"; | import { twMerge } from "tailwind-merge"; | ||||||
| import { clsx, type ClassValue } from "clsx"; | import { clsx, type ClassValue } from "clsx"; | ||||||
| import { EditorLanguageConfig } from "@prisma/client"; | import type { EditorLanguageConfig, Difficulty } from "@prisma/client"; | ||||||
| 
 | 
 | ||||||
| export function cn(...inputs: ClassValue[]) { | export function cn(...inputs: ClassValue[]) { | ||||||
|   return twMerge(clsx(inputs)); |   return twMerge(clsx(inputs)); | ||||||
| @ -12,3 +12,16 @@ export function getPath( | |||||||
| ) { | ) { | ||||||
|   return `file:///${problemId}/${editorLanguageConfig.fileName}${editorLanguageConfig.fileExtension}`; |   return `file:///${problemId}/${editorLanguageConfig.fileName}${editorLanguageConfig.fileExtension}`; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | export const getDifficultyColorClass = (difficulty: Difficulty) => { | ||||||
|  |   switch (difficulty) { | ||||||
|  |     case "EASY": | ||||||
|  |       return "text-green-500"; | ||||||
|  |     case "MEDIUM": | ||||||
|  |       return "text-yellow-500"; | ||||||
|  |     case "HARD": | ||||||
|  |       return "text-red-500"; | ||||||
|  |     default: | ||||||
|  |       return "text-gray-500"; | ||||||
|  |   } | ||||||
|  | }; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user