mirror of
https://github.com/theoludwig/theoludwig.git
synced 2026-08-25 09:21:33 +02:00
build(deps): update next-intl to avoid redirect issue with the port in production + other deps to latest
Ref: https://github.com/amannn/next-intl/pull/2322
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
type ClassDictionary = Record<string, unknown>
|
||||
|
||||
export type ClassValue = ClassDictionary | string | null | boolean | undefined
|
||||
|
||||
/**
|
||||
* Utility for constructing className strings conditionally.
|
||||
* @see https://github.com/lukeed/clsx
|
||||
*/
|
||||
export const clsx = (inputs: ClassValue[]): string => {
|
||||
let result = ""
|
||||
for (const input of inputs) {
|
||||
if (typeof input === "string") {
|
||||
if (input.length > 0) {
|
||||
result = result.length > 0 ? result + " " + input : input
|
||||
}
|
||||
} else if (typeof input === "object" && input !== null) {
|
||||
for (const key of Object.keys(input)) {
|
||||
if (input[key] != null && input[key] !== false && input[key] !== 0 && input[key] !== "") {
|
||||
result = result.length > 0 ? result + " " + key : key
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user