2023-11-09 11:33:13 -05:00
|
|
|
import { useEffect } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import getMeta from '@/utils/meta'
|
|
|
|
import { useLocation } from '@/shared/hooks/use-location'
|
|
|
|
import GroupInvitesItem from './group-invites-item'
|
2024-09-30 05:48:36 -04:00
|
|
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
|
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
2023-11-09 11:33:13 -05:00
|
|
|
|
|
|
|
function GroupInvites() {
|
|
|
|
const { t } = useTranslation()
|
2024-06-18 06:01:37 -04:00
|
|
|
const teamInvites = getMeta('ol-teamInvites')
|
2023-11-09 11:33:13 -05:00
|
|
|
const location = useLocation()
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (teamInvites.length === 0) {
|
|
|
|
location.assign('/project')
|
|
|
|
}
|
|
|
|
}, [teamInvites, location])
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="container">
|
2024-09-30 05:48:36 -04:00
|
|
|
<OLRow>
|
|
|
|
<OLCol lg={{ span: 8, offset: 2 }}>
|
2023-11-09 11:33:13 -05:00
|
|
|
<h1>{t('group_invitations')}</h1>
|
2024-09-30 05:48:36 -04:00
|
|
|
</OLCol>
|
|
|
|
</OLRow>
|
2023-11-09 11:33:13 -05:00
|
|
|
{teamInvites.map(teamInvite => (
|
|
|
|
<GroupInvitesItem teamInvite={teamInvite} key={teamInvite._id} />
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default GroupInvites
|