asv-hlps 1.2.44 → 1.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- export declare type BtnVariant = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
1
+ export declare type VariantType = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
@@ -1 +1 @@
1
- export declare type BtnVariant = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
1
+ export declare type VariantType = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "info";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.2.44",
3
+ "version": "1.2.46",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -1,5 +0,0 @@
1
- declare const useReadonlyFetchTobs: (url: string, httpService: any, urlParam?: string | number, valueProp?: string, labelProp?: string) => {
2
- tobs: any[];
3
- options: any[];
4
- };
5
- export default useReadonlyFetchTobs;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const react_1 = require("react");
13
- const react_utils_1 = require("../../react-utils");
14
- const useReadonlyFetchTobs = (url, httpService, urlParam, valueProp = "id", labelProp = "name") => {
15
- const [tobs, setTobs] = (0, react_1.useState)([]);
16
- const getDatas = () => __awaiter(void 0, void 0, void 0, function* () {
17
- try {
18
- if (!urlParam) {
19
- const { data: tobs } = yield httpService.get(url);
20
- setTobs(tobs);
21
- }
22
- else {
23
- const { data: tobs } = yield httpService.getByParam(urlParam, url);
24
- setTobs(tobs);
25
- }
26
- }
27
- catch (error) { }
28
- });
29
- (0, react_1.useEffect)(() => {
30
- getDatas();
31
- return () => { };
32
- }, []);
33
- // const options = useMemo(() => selectOptionsToLabelAndValue(tobs, valueProp, labelProp), []);
34
- const options = (0, react_utils_1.selectOptionsToLabelAndValue)(tobs, valueProp, labelProp);
35
- return { tobs, options };
36
- };
37
- exports.default = useReadonlyFetchTobs;
38
- // export default {tobs , options} ;
@@ -1,4 +0,0 @@
1
- import useReadonlyFetchTobs from "./hooks/useReadonlyFetchTobs";
2
- import BtnToggle from "./minton/btns/BtnToggle";
3
- import BtnAction from "./minton/btns/BtnAction";
4
- export { useReadonlyFetchTobs, BtnToggle, BtnAction };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BtnAction = exports.BtnToggle = exports.useReadonlyFetchTobs = void 0;
7
- const useReadonlyFetchTobs_1 = __importDefault(require("./hooks/useReadonlyFetchTobs"));
8
- exports.useReadonlyFetchTobs = useReadonlyFetchTobs_1.default;
9
- const BtnToggle_1 = __importDefault(require("./minton/btns/BtnToggle"));
10
- exports.BtnToggle = BtnToggle_1.default;
11
- const BtnAction_1 = __importDefault(require("./minton/btns/BtnAction"));
12
- exports.BtnAction = BtnAction_1.default;
@@ -1,31 +0,0 @@
1
- /// <reference types="react" />
2
- export interface BtnType {
3
- id: number | string;
4
- label: any;
5
- icon?: string;
6
- size?: "sm" | "lg";
7
- variant?: "danger" | "success" | "primary" | "secondary" | "light" | "white" | "link" | string;
8
- disabled?: boolean;
9
- textColor?: "text-danger" | "text-success" | "text-primary" | "text-secondary";
10
- color?: "danger" | "success" | "primary" | "secondary" | string;
11
- divider?: boolean;
12
- btnClass?: string;
13
- }
14
- export interface DropMenuType {
15
- label: string;
16
- icon?: string;
17
- color?: "primary" | "success" | "info" | "danger";
18
- ellipsis?: "v" | "h";
19
- drops: BtnType[];
20
- }
21
- export declare type IfBtnType = "elpDropMenu" | "btnDropMenu" | "btns" | "btnLinks" | "none";
22
- declare type BtnActionProps = {
23
- tob?: any;
24
- onDrop?: any;
25
- onBtn?: any;
26
- ifBtn?: IfBtnType;
27
- dropMenu?: DropMenuType;
28
- btns?: BtnType[];
29
- };
30
- declare const BtnAction: ({ dropMenu, btns, onDrop, onBtn, tob, ifBtn }: BtnActionProps) => JSX.Element;
31
- export default BtnAction;
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const classnames_1 = __importDefault(require("classnames"));
8
- const react_1 = __importDefault(require("react"));
9
- const react_bootstrap_1 = require("react-bootstrap");
10
- // const BtnDrop: React.FC<BtnActionProps> = ({ drops, btns, ellipsis, onDrop, onBtn, tob, ifBtn, btnDrop }) => {
11
- const BtnAction = ({ dropMenu, btns, onDrop, onBtn, tob, ifBtn }) => {
12
- // --------------------
13
- const iconClass = (icon) => {
14
- return icon ? `${icon} me-1` : "me-1";
15
- };
16
- const textColorClass = (textColor) => {
17
- const format = textColor ? `${textColor} ` : "";
18
- return "text-capitalize" + format;
19
- };
20
- const colorClass = (color) => {
21
- return color ? `btn btn-${color} ms-1 ` : "btn btn-primary ms-1";
22
- };
23
- const sizeClass = (size) => {
24
- return size ? `btn-${size}` : "btn-sm";
25
- };
26
- const ellispsisDirection = (ellipsis) => {
27
- let ellipsisDirection = "uil uil-ellipsis-";
28
- return (ellipsisDirection += ellipsis ? ellipsis : "h");
29
- };
30
- const elpDropMenu = () => (
31
- // <ButtonGroup>
32
- (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown, Object.assign({ as: react_bootstrap_1.ButtonGroup, className: "d-inline-block ms-2" }, { children: [(0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Toggle, Object.assign({ as: "a", className: "cursor-pointer arrow-none text-muted" }, { children: (0, jsx_runtime_1.jsx)("i", { className: ellispsisDirection(dropMenu.ellipsis) }) })), (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Menu, { children: react_1.default.Children.toArray(dropMenu.drops.map((drop) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown.Item, Object.assign({ as: "button",
33
- // onClick={(e) => onDrop(e, { id: +drop.id, tob })}
34
- onClick: (e) => {
35
- e.stopPropagation();
36
- e.preventDefault();
37
- onDrop({ id: +drop.id, tob });
38
- },
39
- // onClick={(e) => handleDrop(e)}
40
- // eventKey={drop.id}
41
- // key={drop.id}
42
- // key={index}
43
- className: textColorClass(drop.textColor) }, { children: [(0, jsx_runtime_1.jsx)("i", { className: iconClass(drop.icon) }), drop.label] })), drop.divider ? (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Divider, {}) : ""] })))) })] }))
44
- // </ButtonGroup>
45
- );
46
- const handleDrop = (props) => {
47
- console.log(props);
48
- // console.log(props.target.current.value);
49
- };
50
- const btnDropMenu = () => (
51
- // <ButtonGroup>
52
- (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown, Object.assign({ as: react_bootstrap_1.ButtonGroup, align: "end", size: "sm" }, { children: [(0, jsx_runtime_1.jsxs)(react_bootstrap_1.Dropdown.Toggle, Object.assign({ variant: "primary", id: "dropdown-basic", className: "cursor-pointer" }, { children: [dropMenu.icon && (0, jsx_runtime_1.jsx)("i", { className: iconClass(dropMenu.icon) }), (0, jsx_runtime_1.jsx)("small", Object.assign({ className: "text-uppercase" }, { children: dropMenu === null || dropMenu === void 0 ? void 0 : dropMenu.label })), (0, jsx_runtime_1.jsx)("i", { className: "mdi mdi-chevron-down ms-1" })] })), (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Menu, { children: dropMenu.drops.map((drop) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Item, Object.assign({ className: "notify-item", onClick: () => onDrop(drop.id), eventKey: drop.id }, { children: (0, jsx_runtime_1.jsx)("span", Object.assign({ className: textColorClass(drop.textColor) }, { children: drop.label })) })), drop.divider ? (0, jsx_runtime_1.jsx)(react_bootstrap_1.Dropdown.Divider, {}) : ""] }, drop.id) }))) })] }))
53
- // </ButtonGroup>
54
- );
55
- const btnActions = () => {
56
- return btns.map((btn) => ((0, jsx_runtime_1.jsx)(react_bootstrap_1.ButtonGroup, Object.assign({ className: "ms-1 p-0 text-uppercase", size: "sm" }, { children: (0, jsx_runtime_1.jsxs)(react_bootstrap_1.Button
57
- // className={classNames(colorClass(btn.color), "text-uppercase fs-6 p-0")}
58
- , Object.assign({
59
- // className={classNames(colorClass(btn.color), "text-uppercase fs-6 p-0")}
60
- className: (0, classnames_1.default)(btn.btnClass, "text-uppercase fs-6"), disabled: btn.disabled, variant: btn.variant ? btn.variant : "primary", onClick: (e) => {
61
- e.preventDefault();
62
- e.stopPropagation();
63
- onBtn(btn.id);
64
- }, size: "sm" }, { children: [btn.icon && (0, jsx_runtime_1.jsx)("i", { className: iconClass(btn.icon) }), btn.label] })) }), btn === null || btn === void 0 ? void 0 : btn.id)));
65
- };
66
- const btnLinks = () => {
67
- return btns.map((btn) => ((0, jsx_runtime_1.jsxs)(react_bootstrap_1.Button, Object.assign({ as: "a", className: `${colorClass(btn.color)} ${sizeClass(btn.size)} float-end`, onClick: (e) => {
68
- e.preventDefault();
69
- e.stopPropagation();
70
- onBtn(btn.id);
71
- } }, { children: [btn.icon && (0, jsx_runtime_1.jsx)("i", { className: iconClass(btn.icon) }), btn.label] }), btn === null || btn === void 0 ? void 0 : btn.id)));
72
- };
73
- /* const renderDrop = () => {
74
- switch (ifBtn) {
75
- case "btns":
76
- return dropMenuBtn();
77
- case "elpMenu":
78
- return dropMenu();
79
- case "btn":
80
- return btnActions();
81
- default:
82
- return dropMenu();
83
- }
84
- }; */
85
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [ifBtn === "btnDropMenu" && btnDropMenu(), ifBtn === "elpDropMenu" && elpDropMenu(), ifBtn === "btns" && btnActions(), ifBtn === "btnLinks" && btnLinks()] }));
86
- };
87
- exports.default = BtnAction;
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- declare type BtnToggleProps = {
3
- check: boolean;
4
- onToggle: any;
5
- theme?: "bullhorn" | "userLock" | "thumbs";
6
- };
7
- declare const BtnToggle: React.FC<BtnToggleProps>;
8
- export default BtnToggle;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const BtnToggle = ({ check, onToggle, theme }) => {
5
- const toggle = () => {
6
- let icon = "fas fa-";
7
- switch (theme) {
8
- case "bullhorn":
9
- return check ? (icon += "bullhorn text-success") : (icon += "bullhorn text-danger");
10
- case "userLock":
11
- return check ? (icon += "user-plus text-success") : (icon += "user-lock text-danger");
12
- case "thumbs":
13
- return check ? (icon += "thumbs-up text-success") : (icon += "thumbs-down text-danger");
14
- default:
15
- return check ? (icon += "check") : (icon += "times");
16
- }
17
- };
18
- return ((0, jsx_runtime_1.jsx)("span", Object.assign({ role: "button", onClick: onToggle }, { children: (0, jsx_runtime_1.jsx)("i", { className: toggle() }) })));
19
- };
20
- exports.default = BtnToggle;
@@ -1,5 +0,0 @@
1
- declare const useReadonlyFetchTobs: (url: string, httpService: any, urlParam?: string | number, valueProp?: string, labelProp?: string) => {
2
- tobs: any[];
3
- options: any[];
4
- };
5
- export default useReadonlyFetchTobs;
@@ -1,36 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { useEffect, useState } from "react";
11
- import { selectOptionsToLabelAndValue } from "../../react-utils";
12
- const useReadonlyFetchTobs = (url, httpService, urlParam, valueProp = "id", labelProp = "name") => {
13
- const [tobs, setTobs] = useState([]);
14
- const getDatas = () => __awaiter(void 0, void 0, void 0, function* () {
15
- try {
16
- if (!urlParam) {
17
- const { data: tobs } = yield httpService.get(url);
18
- setTobs(tobs);
19
- }
20
- else {
21
- const { data: tobs } = yield httpService.getByParam(urlParam, url);
22
- setTobs(tobs);
23
- }
24
- }
25
- catch (error) { }
26
- });
27
- useEffect(() => {
28
- getDatas();
29
- return () => { };
30
- }, []);
31
- // const options = useMemo(() => selectOptionsToLabelAndValue(tobs, valueProp, labelProp), []);
32
- const options = selectOptionsToLabelAndValue(tobs, valueProp, labelProp);
33
- return { tobs, options };
34
- };
35
- export default useReadonlyFetchTobs;
36
- // export default {tobs , options} ;
@@ -1,4 +0,0 @@
1
- import useReadonlyFetchTobs from "./hooks/useReadonlyFetchTobs";
2
- import BtnToggle from "./minton/btns/BtnToggle";
3
- import BtnAction from "./minton/btns/BtnAction";
4
- export { useReadonlyFetchTobs, BtnToggle, BtnAction };
@@ -1,4 +0,0 @@
1
- import useReadonlyFetchTobs from "./hooks/useReadonlyFetchTobs";
2
- import BtnToggle from "./minton/btns/BtnToggle";
3
- import BtnAction from "./minton/btns/BtnAction";
4
- export { useReadonlyFetchTobs, BtnToggle, BtnAction };
@@ -1,31 +0,0 @@
1
- /// <reference types="react" />
2
- export interface BtnType {
3
- id: number | string;
4
- label: any;
5
- icon?: string;
6
- size?: "sm" | "lg";
7
- variant?: "danger" | "success" | "primary" | "secondary" | "light" | "white" | "link" | string;
8
- disabled?: boolean;
9
- textColor?: "text-danger" | "text-success" | "text-primary" | "text-secondary";
10
- color?: "danger" | "success" | "primary" | "secondary" | string;
11
- divider?: boolean;
12
- btnClass?: string;
13
- }
14
- export interface DropMenuType {
15
- label: string;
16
- icon?: string;
17
- color?: "primary" | "success" | "info" | "danger";
18
- ellipsis?: "v" | "h";
19
- drops: BtnType[];
20
- }
21
- export declare type IfBtnType = "elpDropMenu" | "btnDropMenu" | "btns" | "btnLinks" | "none";
22
- declare type BtnActionProps = {
23
- tob?: any;
24
- onDrop?: any;
25
- onBtn?: any;
26
- ifBtn?: IfBtnType;
27
- dropMenu?: DropMenuType;
28
- btns?: BtnType[];
29
- };
30
- declare const BtnAction: ({ dropMenu, btns, onDrop, onBtn, tob, ifBtn }: BtnActionProps) => JSX.Element;
31
- export default BtnAction;
@@ -1,82 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import classNames from "classnames";
3
- import React from "react";
4
- import { Button, ButtonGroup, Dropdown } from "react-bootstrap";
5
- // const BtnDrop: React.FC<BtnActionProps> = ({ drops, btns, ellipsis, onDrop, onBtn, tob, ifBtn, btnDrop }) => {
6
- const BtnAction = ({ dropMenu, btns, onDrop, onBtn, tob, ifBtn }) => {
7
- // --------------------
8
- const iconClass = (icon) => {
9
- return icon ? `${icon} me-1` : "me-1";
10
- };
11
- const textColorClass = (textColor) => {
12
- const format = textColor ? `${textColor} ` : "";
13
- return "text-capitalize" + format;
14
- };
15
- const colorClass = (color) => {
16
- return color ? `btn btn-${color} ms-1 ` : "btn btn-primary ms-1";
17
- };
18
- const sizeClass = (size) => {
19
- return size ? `btn-${size}` : "btn-sm";
20
- };
21
- const ellispsisDirection = (ellipsis) => {
22
- let ellipsisDirection = "uil uil-ellipsis-";
23
- return (ellipsisDirection += ellipsis ? ellipsis : "h");
24
- };
25
- const elpDropMenu = () => (
26
- // <ButtonGroup>
27
- _jsxs(Dropdown, Object.assign({ as: ButtonGroup, className: "d-inline-block ms-2" }, { children: [_jsx(Dropdown.Toggle, Object.assign({ as: "a", className: "cursor-pointer arrow-none text-muted" }, { children: _jsx("i", { className: ellispsisDirection(dropMenu.ellipsis) }) })), _jsx(Dropdown.Menu, { children: React.Children.toArray(dropMenu.drops.map((drop) => (_jsxs(_Fragment, { children: [_jsxs(Dropdown.Item, Object.assign({ as: "button",
28
- // onClick={(e) => onDrop(e, { id: +drop.id, tob })}
29
- onClick: (e) => {
30
- e.stopPropagation();
31
- e.preventDefault();
32
- onDrop({ id: +drop.id, tob });
33
- },
34
- // onClick={(e) => handleDrop(e)}
35
- // eventKey={drop.id}
36
- // key={drop.id}
37
- // key={index}
38
- className: textColorClass(drop.textColor) }, { children: [_jsx("i", { className: iconClass(drop.icon) }), drop.label] })), drop.divider ? _jsx(Dropdown.Divider, {}) : ""] })))) })] }))
39
- // </ButtonGroup>
40
- );
41
- const handleDrop = (props) => {
42
- console.log(props);
43
- // console.log(props.target.current.value);
44
- };
45
- const btnDropMenu = () => (
46
- // <ButtonGroup>
47
- _jsxs(Dropdown, Object.assign({ as: ButtonGroup, align: "end", size: "sm" }, { children: [_jsxs(Dropdown.Toggle, Object.assign({ variant: "primary", id: "dropdown-basic", className: "cursor-pointer" }, { children: [dropMenu.icon && _jsx("i", { className: iconClass(dropMenu.icon) }), _jsx("small", Object.assign({ className: "text-uppercase" }, { children: dropMenu === null || dropMenu === void 0 ? void 0 : dropMenu.label })), _jsx("i", { className: "mdi mdi-chevron-down ms-1" })] })), _jsx(Dropdown.Menu, { children: dropMenu.drops.map((drop) => (_jsx(_Fragment, { children: _jsxs("span", { children: [_jsx(Dropdown.Item, Object.assign({ className: "notify-item", onClick: () => onDrop(drop.id), eventKey: drop.id }, { children: _jsx("span", Object.assign({ className: textColorClass(drop.textColor) }, { children: drop.label })) })), drop.divider ? _jsx(Dropdown.Divider, {}) : ""] }, drop.id) }))) })] }))
48
- // </ButtonGroup>
49
- );
50
- const btnActions = () => {
51
- return btns.map((btn) => (_jsx(ButtonGroup, Object.assign({ className: "ms-1 p-0 text-uppercase", size: "sm" }, { children: _jsxs(Button
52
- // className={classNames(colorClass(btn.color), "text-uppercase fs-6 p-0")}
53
- , Object.assign({
54
- // className={classNames(colorClass(btn.color), "text-uppercase fs-6 p-0")}
55
- className: classNames(btn.btnClass, "text-uppercase fs-6"), disabled: btn.disabled, variant: btn.variant ? btn.variant : "primary", onClick: (e) => {
56
- e.preventDefault();
57
- e.stopPropagation();
58
- onBtn(btn.id);
59
- }, size: "sm" }, { children: [btn.icon && _jsx("i", { className: iconClass(btn.icon) }), btn.label] })) }), btn === null || btn === void 0 ? void 0 : btn.id)));
60
- };
61
- const btnLinks = () => {
62
- return btns.map((btn) => (_jsxs(Button, Object.assign({ as: "a", className: `${colorClass(btn.color)} ${sizeClass(btn.size)} float-end`, onClick: (e) => {
63
- e.preventDefault();
64
- e.stopPropagation();
65
- onBtn(btn.id);
66
- } }, { children: [btn.icon && _jsx("i", { className: iconClass(btn.icon) }), btn.label] }), btn === null || btn === void 0 ? void 0 : btn.id)));
67
- };
68
- /* const renderDrop = () => {
69
- switch (ifBtn) {
70
- case "btns":
71
- return dropMenuBtn();
72
- case "elpMenu":
73
- return dropMenu();
74
- case "btn":
75
- return btnActions();
76
- default:
77
- return dropMenu();
78
- }
79
- }; */
80
- return (_jsxs(_Fragment, { children: [ifBtn === "btnDropMenu" && btnDropMenu(), ifBtn === "elpDropMenu" && elpDropMenu(), ifBtn === "btns" && btnActions(), ifBtn === "btnLinks" && btnLinks()] }));
81
- };
82
- export default BtnAction;
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- declare type BtnToggleProps = {
3
- check: boolean;
4
- onToggle: any;
5
- theme?: "bullhorn" | "userLock" | "thumbs";
6
- };
7
- declare const BtnToggle: React.FC<BtnToggleProps>;
8
- export default BtnToggle;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- const BtnToggle = ({ check, onToggle, theme }) => {
3
- const toggle = () => {
4
- let icon = "fas fa-";
5
- switch (theme) {
6
- case "bullhorn":
7
- return check ? (icon += "bullhorn text-success") : (icon += "bullhorn text-danger");
8
- case "userLock":
9
- return check ? (icon += "user-plus text-success") : (icon += "user-lock text-danger");
10
- case "thumbs":
11
- return check ? (icon += "thumbs-up text-success") : (icon += "thumbs-down text-danger");
12
- default:
13
- return check ? (icon += "check") : (icon += "times");
14
- }
15
- };
16
- return (_jsx("span", Object.assign({ role: "button", onClick: onToggle }, { children: _jsx("i", { className: toggle() }) })));
17
- };
18
- export default BtnToggle;