diff --git a/src/frontend/src/components/ui/button.tsx b/src/frontend/src/components/ui/button.tsx index 00259a99a..40bdcb5c2 100644 --- a/src/frontend/src/components/ui/button.tsx +++ b/src/frontend/src/components/ui/button.tsx @@ -41,14 +41,27 @@ export interface ButtonProps asChild?: boolean; } +function toTitleCase(text: string) { + return text + .split(' ') + .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) + .join(' '); +} + const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { + ({ className, variant, size, asChild = false,children, ...props }, ref) => { const Comp = asChild ? Slot : "button"; + let newChildren = children; + if (typeof(children)==="string"){ + newChildren = toTitleCase(children) + } return ( ); }