{"version":3,"file":"THeadSortBtn.cjs","sources":["../../../../src/components/forms/THeadSortBtn.tsx"],"sourcesContent":["import React from \"react\";\nimport ArrowDownwardOutlinedIcon from \"@mui/icons-material/ArrowDownwardOutlined\";\nimport ArrowUpwardOutlinedIcon from \"@mui/icons-material/ArrowUpwardOutlined\";\n\n/**\n * Props interface for the THeadSortBtn component\n * @interface THeadSortBtnProps\n */\ninterface THeadSortBtnProps {\n  /** The key used for sorting */\n  keys: string;\n  /** The content to display in the table header */\n  labels: React.ReactNode;\n  /** The currently sorted column key */\n  sorted: string;\n  /** Optional minimum width for the column */\n  widths?: string;\n  /** Function to call when clicking the sort button */\n  handleSort: (key: string) => void;\n}\n\n/**\n * A sortable table header component with up/down arrows to indicate sort direction\n *\n * @param {THeadSortBtnProps} props - Component props\n * @returns {JSX.Element} - Rendered component\n */\nconst THeadSortBtn: React.FC<THeadSortBtnProps> = ({\n  keys,\n  labels,\n  sorted,\n  widths = \"auto\",\n  handleSort,\n}) => {\n  return (\n    <th\n      onClick={() => handleSort(keys)}\n      className={`ihub-thead-sort ${sorted === keys ? \"ihub-sorted\" : \"\"}`}\n      style={{ minWidth: widths }}\n    >\n      {labels}\n      {sorted !== keys ? (\n        <ArrowDownwardOutlinedIcon />\n      ) : (\n        <ArrowUpwardOutlinedIcon />\n      )}\n    </th>\n  );\n};\n\nexport default THeadSortBtn;\n"],"names":["_ref","keys","labels","sorted","_ref$widths","widths","handleSort","_jsxs","onClick","className","concat","style","minWidth","children","_jsx","jsx","ArrowDownwardOutlinedIcon","ArrowUpwardOutlinedIcon"],"mappings":"6TA2BkD,SAAhCA,GAMb,IALHC,EAAID,EAAJC,KACAC,EAAMF,EAANE,OACAC,EAAMH,EAANG,OAAMC,EAAAJ,EACNK,OAAAA,OAAS,IAAHD,EAAG,OAAMA,EACfE,EAAUN,EAAVM,WAEA,OACEC,EAAAA,KACE,KAAA,CAAAC,QAAS,WAAF,OAAQF,EAAWL,EAAK,EAC/BQ,UAAS,mBAAAC,OAAqBP,IAAWF,EAAO,cAAgB,IAChEU,MAAO,CAAEC,SAAUP,GAElBQ,SAAA,CAAAX,EACAC,IAAWF,EACVa,EAACC,IAAAC,UAA4B,CAAA,GAE7BF,EAAAA,IAACG,EAAuB,QAAG,CAAA,KAInC"}