spiderwebai-components
Version:
frontend components like ui, hooks, and more used in spider
37 lines • 1.98 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Toaster = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
var toast_1 = require("./toast");
var use_toast_1 = require("./use-toast");
function Toaster() {
var toasts = (0, use_toast_1.useToast)().toasts;
return ((0, jsx_runtime_1.jsxs)(toast_1.ToastProvider, { children: [toasts.map(function (_a) {
var id = _a.id, title = _a.title, description = _a.description, action = _a.action, props = __rest(_a, ["id", "title", "description", "action"]);
return ((0, jsx_runtime_1.jsxs)(toast_1.Toast, __assign({}, props, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid gap-1", children: [title && (0, jsx_runtime_1.jsx)(toast_1.ToastTitle, { children: title }), description && (0, jsx_runtime_1.jsx)(toast_1.ToastDescription, { children: description })] }), action, (0, jsx_runtime_1.jsx)(toast_1.ToastClose, {})] }), id));
}), (0, jsx_runtime_1.jsx)(toast_1.ToastViewport, {})] }));
}
exports.Toaster = Toaster;
//# sourceMappingURL=toaster.js.map