import{j as t,a as v,r as j,h as s,bs as d,H as p,e as x}from"./main-343.js";import{e as h}from"./bf-649-79.js";function m({size:r=20,stroke:n=2,className:e}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,children:t.jsx("path",{fill:"currentColor",d:"M4 20V9h4v11H4Zm6 0V4h4v16h-4Zm6 0v-7h4v7h-4Z"})})}function u({size:r=20,stroke:n=2,className:e}){return t.jsx("svg",{width:r,height:r,fill:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,children:t.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:n,d:"M4 19h16M4 15l4-6l4 2l4-5l4 4"})})}function b({size:r=20,stroke:n=2}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{fill:"currentColor",d:"M15.985 8.5H8.207l-5.5 5.5a8 8 0 0 0 13.277-5.5zM2 13.292A8 8 0 0 1 7.5.015v7.778l-5.5 5.5zM8.5.015V7.5h7.485A8.001 8.001 0 0 0 8.5.015z"})})}const w=d(()=>p(()=>import("./bf-542-383.js"),["./bf-542-383.js","./main-343.js","./main-343.css"],import.meta.url),{fallback:t.jsx(x,{className:"g-c",style:{height:300,width:500}})}),B=d(()=>p(()=>import("./bf-144-384.js"),["./bf-144-384.js","./main-343.js","./main-343.css","./bf-506-112.js","./bf-649-79.js","./bf-899-409.css","./bf-123-272.js","./bf-190-88.js","./bf-90-70.js","./bf-594-113.js","./bf-558-408.css"],import.meta.url),{fallback:t.jsx(x,{className:"g-c",style:{height:300,width:500}})}),g=d(()=>p(()=>import("./bf-586-385.js"),["./bf-586-385.js","./main-343.js","./main-343.css","./bf-506-112.js","./bf-649-79.js","./bf-899-409.css","./bf-123-272.js","./bf-190-88.js","./bf-90-70.js","./bf-594-113.js","./bf-558-408.css"],import.meta.url),{fallback:t.jsx(x,{className:"g-c",style:{height:300,width:500}})}),_=d(()=>p(()=>import("./bf-454-386.js"),["./bf-454-386.js","./main-343.js","./main-343.css","./bf-506-112.js","./bf-649-79.js","./bf-899-409.css","./bf-123-272.js","./bf-190-88.js","./bf-90-70.js","./bf-594-113.js","./bf-558-408.css"],import.meta.url),{fallback:t.jsx(x,{className:"g-c",style:{height:300,width:500}})});function C({title:r,data:n}){const{css:e}=v(),[i,l]=j.useState("hBar"),c=n.title||r,o=n.dataList||[];return t.jsxs("div",{className:e(a.mainWrap),children:[t.jsxs("div",{className:e(a.headerWrap),children:[t.jsx("h4",{children:c}),t.jsxs("div",{className:e(a.viewTypeWrp),children:[t.jsx(h,{msg:"Pie Chart",children:t.jsx("button",{type:"button","aria-label":"chart-button",className:`${e(s.icnBtn,s.icn_hover,a.icnBtn)} ${i==="pie"&&"active"}`,onClick:()=>l("pie"),children:t.jsx(b,{})})}),t.jsx(h,{msg:"Vertical Bar Chart",children:t.jsx("button",{type:"button","aria-label":"vertical-bar-button",className:`${e(s.icnBtn,s.icn_hover,a.icnBtn)} ${i==="hBar"&&"active"}`,onClick:()=>l("hBar"),children:t.jsx(m,{})})}),t.jsx(h,{msg:"Horizontal Bar Chart",children:t.jsx("button",{type:"button","aria-label":"horizontal-bar-button",className:`${e(s.icnBtn,s.icn_hover,a.icnBtn)} ${i==="vBar"&&"active"}`,onClick:()=>l("vBar"),children:t.jsx(m,{className:e({tm:"rotate(90deg)"})})})}),t.jsx(h,{msg:"Line Chart",children:t.jsx("button",{type:"button","aria-label":"line-chart-button",className:`${e(s.icnBtn,s.icn_hover,a.icnBtn)} ${i==="line"&&"active"}`,onClick:()=>l("line"),children:t.jsx(u,{})})})]})]}),t.jsxs("div",{className:e(a.reportBody),children:[t.jsxs("div",{className:e(a.chartBody),children:[i==="pie"&&t.jsx(B,{dataList:o,title:c}),i==="line"&&t.jsx(_,{dataList:o,title:c}),(i==="vBar"||i==="hBar")&&t.jsx(g,{viewType:i,dataList:o,title:c})]}),t.jsx("div",{className:e(a.tableBody),children:t.jsx(w,{dataList:o})})]})]})}const a={mainWrap:{p:"20px",b:"1px solid #ccc",brs:"8px",mb:"20px",bd:"#fff"},icnBtn:{w:"30px",h:"30px",ow:"hidden",brs:"8px"},headerWrap:{dy:"flex",jc:"space-between"},viewTypeWrp:{dy:"flex",ai:"center",jc:"space-between",w:"130px"},reportBody:{dy:"flex",w:"100%",jc:"space-between",gp:10},chartBody:{w:"60%"},tableBody:{w:"40%"}};export{C as default};
