{"version":3,"file":"GraphHeader.cjs","names":[],"sources":["../src/Components/Elements/GraphHeader.tsx"],"sourcesContent":["import type { RefObject } from 'react';\r\n\r\nimport { CsvDownloadButton } from '@/Components/Actions/CsvDownloadButton';\r\nimport { ImageDownloadButton } from '@/Components/Actions/ImageDownloadButton';\r\nimport { GraphDescription } from '@/Components/Typography/GraphDescription';\r\nimport { GraphTitle } from '@/Components/Typography/GraphTitle';\r\n\r\ninterface Props {\r\n  graphTitle?: string | React.ReactNode;\r\n  graphDescription?: string | React.ReactNode;\r\n  width?: number;\r\n  graphDownload?: RefObject<HTMLDivElement | null>;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  dataDownload?: any;\r\n  isDashboard?: boolean;\r\n  styles?: { title?: React.CSSProperties; description?: React.CSSProperties };\r\n  classNames?: { title?: string; description?: string };\r\n}\r\n\r\nexport function GraphHeader(props: Props) {\r\n  const {\r\n    graphTitle,\r\n    graphDescription,\r\n    width,\r\n    graphDownload,\r\n    dataDownload,\r\n    isDashboard,\r\n    styles,\r\n    classNames,\r\n  } = props;\r\n  return (\r\n    <div\r\n      className={`flex gap-2 justify-between pb-4 ${\r\n        graphDescription && graphTitle ? 'items-start' : 'items-center'\r\n      }`}\r\n      style={{ maxWidth: width ? `${width}px` : 'none' }}\r\n    >\r\n      <div className='flex-col flex gap-1'>\r\n        {graphTitle ? (\r\n          <GraphTitle\r\n            text={graphTitle}\r\n            isDashboard={isDashboard}\r\n            style={styles?.title}\r\n            className={classNames?.title}\r\n          />\r\n        ) : null}\r\n        {graphDescription ? (\r\n          <GraphDescription\r\n            text={graphDescription}\r\n            style={styles?.description}\r\n            className={classNames?.description}\r\n          />\r\n        ) : null}\r\n      </div>\r\n      {graphDownload || dataDownload ? (\r\n        <div className='flex gap-3'>\r\n          {graphDownload ? <ImageDownloadButton nodeID={graphDownload} buttonSmall /> : null}\r\n          {dataDownload && dataDownload.length > 0 ? (\r\n            <CsvDownloadButton\r\n              csvData={dataDownload}\r\n              buttonSmall\r\n              headers={Object.keys(dataDownload[0]).map((d) => ({\r\n                label: d,\r\n                key: d,\r\n              }))}\r\n            />\r\n          ) : null}\r\n        </div>\r\n      ) : null}\r\n    </div>\r\n  );\r\n}\r\n"],"mappings":"mSAmBA,SAAgB,EAAY,EAAc,CACxC,GAAM,CACJ,aACA,mBACA,QACA,gBACA,eACA,cACA,SACA,cACE,EACJ,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,mCACT,GAAoB,EAAa,cAAgB,iBAEnD,MAAO,CAAE,SAAU,EAAQ,GAAG,EAAM,IAAM,MAAO,WAJnD,EAME,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,CACG,GACC,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,KAAM,EACO,cACb,MAAO,GAAQ,MACf,UAAW,GAAY,KACxB,CAAA,EACC,KACH,GACC,EAAA,EAAA,KAAC,EAAA,iBAAD,CACE,KAAM,EACN,MAAO,GAAQ,YACf,UAAW,GAAY,WACxB,CAAA,EACC,IACD,IACJ,GAAiB,GAChB,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sBAAf,CACG,GAAgB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,OAAQ,EAAe,YAAA,EAAa,CAAA,EAAI,KAC7E,GAAgB,EAAa,OAAS,GACrC,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,QAAS,EACT,YAAA,GACA,QAAS,OAAO,KAAK,EAAa,EAAE,EAAE,IAAK,IAAO,CAChD,MAAO,EACP,IAAK,CACP,EAAE,CACH,CAAA,EACC,IACD,IACH,IACD,GAET"}