1 | "use client";
|
2 |
|
3 | import classNames from 'classnames';
|
4 | import * as React from 'react';
|
5 | import { useBootstrapPrefix } from './ThemeProvider';
|
6 | import { jsx as _jsx } from "react/jsx-runtime";
|
7 | const positionClasses = {
|
8 | 'top-start': 'top-0 start-0',
|
9 | 'top-center': 'top-0 start-50 translate-middle-x',
|
10 | 'top-end': 'top-0 end-0',
|
11 | 'middle-start': 'top-50 start-0 translate-middle-y',
|
12 | 'middle-center': 'top-50 start-50 translate-middle',
|
13 | 'middle-end': 'top-50 end-0 translate-middle-y',
|
14 | 'bottom-start': 'bottom-0 start-0',
|
15 | 'bottom-center': 'bottom-0 start-50 translate-middle-x',
|
16 | 'bottom-end': 'bottom-0 end-0'
|
17 | };
|
18 | const ToastContainer = React.forwardRef(({
|
19 | bsPrefix,
|
20 | position,
|
21 | containerPosition,
|
22 | className,
|
23 |
|
24 | as: Component = 'div',
|
25 | ...props
|
26 | }, ref) => {
|
27 | bsPrefix = useBootstrapPrefix(bsPrefix, 'toast-container');
|
28 | return _jsx(Component, {
|
29 | ref: ref,
|
30 | ...props,
|
31 | className: classNames(bsPrefix, position && positionClasses[position], containerPosition && `position-${containerPosition}`, className)
|
32 | });
|
33 | });
|
34 | ToastContainer.displayName = 'ToastContainer';
|
35 | export default ToastContainer; |
\ | No newline at end of file |