Skip to content

Commit 6201c0d

Browse files
committed
added documentation
1 parent 0895700 commit 6201c0d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

frontend/src/components/utils/Toast.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ type Props = {
2323
time: number;
2424
};
2525

26+
/**
27+
* Toast Component – Displays a notification or "toast" message.
28+
*
29+
* @remarks
30+
* The toast appears for a limited time and then disappears. The toast's
31+
* color depends on its severity (type of notification).
32+
*
33+
* @param {boolean} props.isOpen - Controls the initial visibility of the toast.
34+
* @param {AlertProps['color']} props.severity - The type of the alert which determines
35+
* color of the toast. Can be one of the following: 'success', 'info', 'warning', 'error'.
36+
* @param {string} props.message - The message content of the alert.
37+
* @param {number} props.time - The duration (in milliseconds) the toast is visible
38+
* for before it automatically closes.
39+
*
40+
* @return {JSX.Element} The rendered Toast component.
41+
*/
42+
2643
const Toast = ({ isOpen, severity, message, time }: Props) => {
2744
const classes = useStyles();
2845
const [open, setOpen] = useState(isOpen);

0 commit comments

Comments
 (0)