mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-14 08:03:48 -05:00
feat: add new filters
This commit is contained in:
@@ -1,6 +1,30 @@
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import type { Image } from "./types";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function getDescription(image: Image) {
|
||||
switch (image.result.has_update) {
|
||||
case null:
|
||||
return "Unknown";
|
||||
case false:
|
||||
return "Up to date";
|
||||
case true:
|
||||
if (image.result.info?.type === "version") {
|
||||
switch (image.result.info.version_update_type) {
|
||||
case "major":
|
||||
return "Major update";
|
||||
case "minor":
|
||||
return "Minor update";
|
||||
case "patch":
|
||||
return "Patch update";
|
||||
}
|
||||
} else if (image.result.info?.type === "digest") {
|
||||
return "Digest update";
|
||||
}
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user