@campxdev/shared 1.10.14 → 1.10.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.10.14",
3
+ "version": "1.10.16",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,6 +1,7 @@
1
1
  import { Tab } from '@mui/material'
2
2
  import { ChangeEvent, ReactNode, useEffect, useState } from 'react'
3
3
  import { StyledComponentWrapper, StyledContainer, StyledTabs } from './styles'
4
+ import ErrorBoundary from '../ErrorBoundary'
4
5
 
5
6
  export interface TabsContainerProps {
6
7
  tabs: {
@@ -46,7 +47,9 @@ export default function TabsContainer({
46
47
  ))}
47
48
  </StyledTabs>
48
49
  <StyledComponentWrapper containerVariant={conatinerVariant}>
49
- {tabs.find((tab) => tab.key === currentTab)?.component}
50
+ <ErrorBoundary>
51
+ {tabs.find((tab) => tab.key === currentTab)?.component}
52
+ </ErrorBoundary>
50
53
  </StyledComponentWrapper>
51
54
  </StyledContainer>
52
55
  )
@@ -35,7 +35,7 @@ const ApplicationObj = {
35
35
  payments: 'payments',
36
36
  exams: 'exams',
37
37
  hostel: 'hostels',
38
- hrms: 'hrms',
38
+ people: 'hrms',
39
39
  }
40
40
  const checkIsAdmin = (user) => {
41
41
  let subDomain = window.location.host.split('.')?.slice(-3)[0]
@@ -0,0 +1,11 @@
1
+ export default function buffertoCSV({ data, filename }) {
2
+ const blob = new Blob([data], { type: 'text/csv' })
3
+ const url = URL.createObjectURL(blob)
4
+ const link = document.createElement('a')
5
+
6
+ link.href = url
7
+ link.download = `${filename}.csv`
8
+ link.click()
9
+
10
+ URL.revokeObjectURL(url)
11
+ }
@@ -1,6 +1,7 @@
1
1
  export { default as getUrlParams } from './getUrlParams'
2
2
  export { default as arrayPadEnd } from './arrayPadEnd'
3
3
  export { default as romanize } from './romanize'
4
+ export { default as buffertoCSV } from './buffertoCSV'
4
5
 
5
6
  export { default as withRouteWrapper } from './withRouteWrapper'
6
7
  export { default as withSuspense } from './withSuspense'