refactor: consolidate shared application helpers
This commit is contained in:
+5
-1
@@ -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;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user