mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 00:10:03 +02:00
docs: adding docstring to ConnectionToast
This commit is contained in:
parent
c4056d3ca8
commit
7f402b45e7
@ -5,6 +5,21 @@ type ConnectionToastProps = {
|
|||||||
connectionStatus: string;
|
connectionStatus: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ConnectionToast Component
|
||||||
|
*
|
||||||
|
* Displays a toast notification that reflects the current connection status.
|
||||||
|
*
|
||||||
|
* Props:
|
||||||
|
* - connectionStatus (string): The current status of the connection which can be
|
||||||
|
* 'connecting', 'connected', 'disconnected', or 'reconnecting'. The component uses this
|
||||||
|
* status to determine the message, background color (`bg`), and auto-hide delay of the toast.
|
||||||
|
*
|
||||||
|
* The toast is designed to automatically appear based on changes to the `connectionStatus` prop
|
||||||
|
* and provides a close button to manually dismiss the toast. It uses `react-bootstrap`'s Toast
|
||||||
|
* component to show the connection status in a stylized format, and Bootstrap's utility classes
|
||||||
|
* for alignment and spacing.
|
||||||
|
*/
|
||||||
export const ConnectionToast = React.memo(
|
export const ConnectionToast = React.memo(
|
||||||
({ connectionStatus }: ConnectionToastProps) => {
|
({ connectionStatus }: ConnectionToastProps) => {
|
||||||
const [show, setShow] = useState(true);
|
const [show, setShow] = useState(true);
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user