module.exports=[54156,a=>{a.v({container:"LoadingSkeletonTable-module__RJoUDa__container",loading:"LoadingSkeletonTable-module__RJoUDa__loading",skeletonAnimation:"LoadingSkeletonTable-module__RJoUDa__skeletonAnimation",skeletonBox:"LoadingSkeletonTable-module__RJoUDa__skeletonBox",skeletonCell:"LoadingSkeletonTable-module__RJoUDa__skeletonCell",skeletonRow:"LoadingSkeletonTable-module__RJoUDa__skeletonRow",skeletonTable:"LoadingSkeletonTable-module__RJoUDa__skeletonTable"})},89362,a=>{"use strict";var b=a.i(87924);a.i(72131);var c=a.i(54156);a.s(["default",0,()=>(0,b.jsx)("div",{className:c.default.container,children:(0,b.jsxs)("table",{className:c.default.skeletonTable,children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})}),(0,b.jsx)("th",{children:(0,b.jsx)("div",{className:c.default.skeletonBox})})]})}),(0,b.jsx)("tbody",{children:[...Array(8)].map((a,d)=>(0,b.jsx)("tr",{className:c.default.skeletonRow,children:[...Array(8)].map((a,d)=>(0,b.jsx)("td",{className:c.default.skeletonCell,children:(0,b.jsx)("div",{className:c.default.skeletonBox,children:(0,b.jsx)("div",{className:c.default.skeletonAnimation})})},d))},d))})]})})])},47710,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(95940),e=a.i(14174),f=a.i(38246),g=a.i(82892),h=a.i(89362);a.s(["default",0,()=>{let[a,i]=(0,c.useState)([]),[j,k]=(0,c.useState)([]),[l,m]=(0,c.useState)(!0),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(""),r=(0,d.getCookie)("token");return((0,e.useSelector)(a=>a.user.userInfo),(0,c.useEffect)(()=>{let a=async()=>{try{let a=await (0,g.default)("/api/companies/all-brands/sa","GET");i(a),k(a),m(!1)}catch(a){console.error("Error fetching brands:",a.message),o("Failed to fetch brands"),m(!1)}};r&&a()},[r]),(0,c.useEffect)(()=>{let b=p.toLowerCase();k(a.filter(a=>[a?.brandName,a?.url,a?.company].filter(Boolean).some(a=>a.toLowerCase().includes(b))))},[p,a]),l)?(0,b.jsx)(h.default,{}):n?(0,b.jsxs)("div",{children:["Error: ",n]}):(0,b.jsxs)("div",{className:"container-fluid table-container table-responsive",children:[(0,b.jsx)("h2",{className:"my-3",children:"Brands"}),(0,b.jsx)("div",{className:"mb-3",children:(0,b.jsx)("input",{type:"text",className:"form-control",placeholder:"Search by Brand Name, URL, or Company",value:p,onChange:a=>q(a.target.value)})}),(0,b.jsxs)("table",{className:"table table-striped mt-4",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{children:"Logo"}),(0,b.jsx)("th",{children:"Brand Name"}),(0,b.jsx)("th",{children:"URL"}),(0,b.jsx)("th",{children:"Company"}),(0,b.jsx)("th",{children:"Phone"}),(0,b.jsx)("th",{children:"Email"}),(0,b.jsx)("th",{children:"Status"}),(0,b.jsx)("th",{children:"Action"})]})}),(0,b.jsx)("tbody",{children:j.map(a=>(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:(0,b.jsx)("img",{src:a?.logo||"/assets/images/dp.png",alt:a?.brandName||"Brand Logo",width:50,height:50,onError:a=>a.target.src="/assets/images/dp.png",className:"img-thumbnail"})}),(0,b.jsx)("td",{children:(0,b.jsx)(f.default,{href:`company-management/${a?.company_id}/brands/${a?.brand_id}`,children:a?.brandName||"N/A"})}),(0,b.jsx)("td",{children:(0,b.jsx)("a",{href:a?.url,target:"_blank",rel:"noopener noreferrer",children:a?.url||"N/A"})}),(0,b.jsx)("td",{children:(0,b.jsx)(f.default,{href:`company-management/${a?.company_id}`,children:a?.company||"N/A"})}),(0,b.jsx)("td",{children:a?.phone||"N/A"}),(0,b.jsx)("td",{children:a?.email||"N/A"}),(0,b.jsx)("td",{children:a?.status}),(0,b.jsx)("td",{className:"table-end-buttons",children:(0,b.jsx)(f.default,{prefetch:!1,href:`/company-management/${a?.company_id}/brand-assign-user/${a.brand_id}`,children:(0,b.jsx)("button",{className:"btn btn-sm p-0 text-sm-center py-2 px-1   p-btn w-100 ",children:"Assign User"})})})]},a.brand_id))})]})]})}])}];

//# sourceMappingURL=app_%28dashboard%29_c2a376b3._.js.map