Skip to content

Commit 4482946

Browse files
committed
feat: document className tool
1 parent e4fc7c1 commit 4482946

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

GUI/ETVR/src/utils/utils.ts

+16
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ export const ActiveStatus = (activeStatus: CameraStatus) => {
3434
}
3535
}
3636

37+
/**
38+
* @description Returns a string of classes based on the boolean value
39+
* @param classes
40+
* @param boolean
41+
* @example
42+
* ```tsx
43+
* <ChevronDownIcon
44+
* class={classNames(
45+
* isOpen() && 'text-opacity-70',
46+
* 'ml-2 h-5 w-5 text-orange-300 group-hover:text-opacity-80 transition ease-in-out duration-150',
47+
* )}
48+
* aria-hidden="true"
49+
* />
50+
* ```
51+
* @returns string of classes
52+
*/
3753
export const classNames = (...classes: (string | boolean | undefined)[]): string => {
3854
return classes.filter(Boolean).join(' ')
3955
}

0 commit comments

Comments
 (0)