import React from 'react'; import { useGroupLookup } from 'soapbox/api/hooks'; import ColumnLoading from 'soapbox/features/ui/components/column-loading'; import { Layout } from '../ui'; interface IGroupLookup { params: { groupSlug: string } } interface IMaybeGroupLookup { params?: { groupSlug?: string groupId?: string } } function GroupLookupHoc(Component: React.ComponentType<{ params: { groupId: string } }>) { const GroupLookup: React.FC = (props) => { const { entity: group } = useGroupLookup(props.params.groupSlug); if (!group) return ( <> ); const newProps = { ...props, params: { ...props.params, id: group.id, groupId: group.id, }, }; return ( ); }; const MaybeGroupLookup: React.FC = (props) => { const { params } = props; if (params?.groupId) { return ; } else { return ; } }; return MaybeGroupLookup; } export default GroupLookupHoc;