refactor: consolidate shared application helpers

This commit is contained in:
2026-07-29 12:28:51 +07:00 Unverified
parent 1fb154b465
commit 6b0440602b
14 changed files with 45 additions and 45 deletions
+5 -1
View File
@@ -5,6 +5,10 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function getErrorMessage(error: unknown, fallback: string) {
return error instanceof Error ? error.message : fallback;
}
export const stripHtml = (html: string) => {
return (html || "").replace(/<[^>]*>?/gm, '').trim();
};
@@ -17,4 +21,4 @@ export const copyToClipboard = async (text: string): Promise<boolean> => {
console.error("Copy error:", error);
return false;
}
};
};