sccoreui
Version:
ui-sccore
21 lines (20 loc) • 1.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const button_1 = require("primereact/button");
const react_1 = require("react");
const context_provider_1 = require("../context-provider");
const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
const GridViewListView = () => {
const { gridViewFun, gridView, isDataLoading } = (0, react_1.useContext)(context_provider_1.FeatureContext);
const loadingStyle = isDataLoading
? { pointerEvents: "none" }
: undefined;
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex border-1 border-gray-300 border-round-6" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: `border-round-sm border-noround-right sc_icon_hover ${!gridView
? "focus:shadow-none"
: "bg-primary-50 focus:shadow-none border-right-1 border-gray-300"} `, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", color: !gridView ? "text-gray-600" : "text-primary-400", size: 18 }), outlined: true, style: loadingStyle, onClick: () => gridViewFun(true), title: "Card View" }), (0, jsx_runtime_1.jsx)(button_1.Button, { title: "List View", className: `sc_icon_hover border-round-sm border-noround-left border-left-none ${!gridView
? "bg-primary-50 focus:shadow-none"
: "focus:shadow-none border-left-1 border-gray-300"} `, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "list", color: !gridView ? "text-primary-400" : "text-gray-600", size: 18 }), outlined: true, style: loadingStyle, onClick: () => gridViewFun(false) })] })));
};
exports.default = GridViewListView;