(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,91896,e=>{e.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"})},1782,e=>{"use strict";var a=e.i(43476);e.i(71645);var s=e.i(91896);e.s(["default",0,()=>(0,a.jsx)("div",{className:s.default.container,children:(0,a.jsxs)("table",{className:s.default.skeletonTable,children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})}),(0,a.jsx)("th",{children:(0,a.jsx)("div",{className:s.default.skeletonBox})})]})}),(0,a.jsx)("tbody",{children:[...Array(8)].map((e,l)=>(0,a.jsx)("tr",{className:s.default.skeletonRow,children:[...Array(8)].map((e,l)=>(0,a.jsx)("td",{className:s.default.skeletonCell,children:(0,a.jsx)("div",{className:s.default.skeletonBox,children:(0,a.jsx)("div",{className:s.default.skeletonAnimation})})},l))},l))})]})})])},96827,e=>{"use strict";var a=e.i(43476),s=e.i(71645),l=e.i(3903),t=e.i(55487),n=e.i(22016),d=e.i(75385),o=e.i(1782);e.s(["default",0,()=>{let[e,r]=(0,s.useState)([]),[i,c]=(0,s.useState)([]),[h,m]=(0,s.useState)(!0),[x,u]=(0,s.useState)(null),[j,b]=(0,s.useState)(""),f=(0,l.getCookie)("token");return((0,t.useSelector)(e=>e.user.userInfo),(0,s.useEffect)(()=>{let e=async()=>{try{let e=await (0,d.default)("/api/companies/all-brands/sa","GET");r(e),c(e),m(!1)}catch(e){console.error("Error fetching brands:",e.message),u("Failed to fetch brands"),m(!1)}};f&&e()},[f]),(0,s.useEffect)(()=>{let a=j.toLowerCase();c(e.filter(e=>[e?.brandName,e?.url,e?.company].filter(Boolean).some(e=>e.toLowerCase().includes(a))))},[j,e]),h)?(0,a.jsx)(o.default,{}):x?(0,a.jsxs)("div",{children:["Error: ",x]}):(0,a.jsxs)("div",{className:"container-fluid table-container table-responsive",children:[(0,a.jsx)("h2",{className:"my-3",children:"Brands"}),(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)("input",{type:"text",className:"form-control",placeholder:"Search by Brand Name, URL, or Company",value:j,onChange:e=>b(e.target.value)})}),(0,a.jsxs)("table",{className:"table table-striped mt-4",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{children:"Logo"}),(0,a.jsx)("th",{children:"Brand Name"}),(0,a.jsx)("th",{children:"URL"}),(0,a.jsx)("th",{children:"Company"}),(0,a.jsx)("th",{children:"Phone"}),(0,a.jsx)("th",{children:"Email"}),(0,a.jsx)("th",{children:"Status"}),(0,a.jsx)("th",{children:"Action"})]})}),(0,a.jsx)("tbody",{children:i.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{children:(0,a.jsx)("img",{src:e?.logo||"/assets/images/dp.png",alt:e?.brandName||"Brand Logo",width:50,height:50,onError:e=>e.target.src="/assets/images/dp.png",className:"img-thumbnail"})}),(0,a.jsx)("td",{children:(0,a.jsx)(n.default,{href:`company-management/${e?.company_id}/brands/${e?.brand_id}`,children:e?.brandName||"N/A"})}),(0,a.jsx)("td",{children:(0,a.jsx)("a",{href:e?.url,target:"_blank",rel:"noopener noreferrer",children:e?.url||"N/A"})}),(0,a.jsx)("td",{children:(0,a.jsx)(n.default,{href:`company-management/${e?.company_id}`,children:e?.company||"N/A"})}),(0,a.jsx)("td",{children:e?.phone||"N/A"}),(0,a.jsx)("td",{children:e?.email||"N/A"}),(0,a.jsx)("td",{children:e?.status}),(0,a.jsx)("td",{className:"table-end-buttons",children:(0,a.jsx)(n.default,{prefetch:!1,href:`/company-management/${e?.company_id}/brand-assign-user/${e.brand_id}`,children:(0,a.jsx)("button",{className:"btn btn-sm p-0 text-sm-center py-2 px-1   p-btn w-100 ",children:"Assign User"})})})]},e.brand_id))})]})]})}])}]);