Files
oneuptime/Common/UI/Components/StatusBubble/StatusBubble.tsx
Nawaz Dhandala e9d5a560ff Refactor migration files and improve code formatting
- Updated migration files to enhance readability by adjusting indentation and line breaks.
- Added missing commas in the index file for migration imports.
- Improved accessibility attributes in various UI components by ensuring proper aria-labels and roles.
- Refactored key event handlers in UI components for better clarity and consistency.
- Enhanced error message handling in form components to ensure proper display and accessibility.
- Updated legacy function comments for clarity and maintainability.
2026-01-26 19:23:58 +00:00

57 lines
1.5 KiB
TypeScript

import { Black } from "../../../Types/BrandColors";
import Color from "../../../Types/Color";
import React, { CSSProperties, FunctionComponent, ReactElement } from "react";
export interface ComponentProps {
text: string;
color: Color;
style?: CSSProperties;
shouldAnimate: boolean;
}
const Statusbubble: FunctionComponent<ComponentProps> = (
props: ComponentProps,
): ReactElement => {
const backgroundColor: string = props.color
? props.color.toString()
: Black.toString();
return (
<div
className="flex"
style={props.style}
role="status"
aria-label={`Status: ${props.text}`}
>
<div className="-mr-2 ml-5" aria-hidden="true">
<span className="relative -left-1 -translate-x-full top-1/2 -translate-y-1/2 flex h-3.5 w-3.5">
<span
className={`${
props.shouldAnimate ? "motion-safe:animate-ping" : ""
} absolute inline-flex h-full w-full rounded-full`}
style={{
backgroundColor: backgroundColor,
}}
></span>
<span
className="relative inline-flex rounded-full h-3.5 w-3.5"
style={{
backgroundColor: backgroundColor,
}}
></span>
</span>
</div>
<div
className="text-sm font-medium"
style={{
color: props.color ? props.color.toString() : Black.toString(),
}}
>
{props.text}
</div>
</div>
);
};
export default Statusbubble;