({
currentCommunity,
api,
}: {
currentCommunity: SerializedAccount;
api: ApiClient;
})
| 14 | import type { ApiClient } from '@linen/api-client'; |
| 15 | |
| 16 | export default function ConfigurationsView({ |
| 17 | currentCommunity, |
| 18 | api, |
| 19 | }: { |
| 20 | currentCommunity: SerializedAccount; |
| 21 | api: ApiClient; |
| 22 | }) { |
| 23 | const updateAccount = useCallback(debounce(api.updateAccount), []); |
| 24 | |
| 25 | return ( |
| 26 | <div className={styles.wrapper}> |
| 27 | <Header /> |
| 28 | <div className={styles.container}> |
| 29 | <CommunityIntegrationRow |
| 30 | currentCommunity={currentCommunity} |
| 31 | api={api} |
| 32 | /> |
| 33 | <hr className={styles.my3} /> |
| 34 | {currentCommunity.communityType !== 'discord' && ( |
| 35 | <> |
| 36 | <SlackImportRow currentCommunity={currentCommunity} api={api} /> |
| 37 | <hr className={styles.my3} /> |
| 38 | </> |
| 39 | )} |
| 40 | <AnonymizeUsersRow currentCommunity={currentCommunity} api={api} /> |
| 41 | <hr className={styles.my3} /> |
| 42 | <ChannelsConfig currentCommunity={currentCommunity} api={api} /> |
| 43 | <hr className={styles.my3} /> |
| 44 | <UrlsRow currentCommunity={currentCommunity} api={api} /> |
| 45 | <hr className={styles.my3} /> |
| 46 | <CommunityTypeRow |
| 47 | type={currentCommunity.type} |
| 48 | disabled={!currentCommunity.premium} |
| 49 | onChange={(type: AccountType) => { |
| 50 | updateAccount({ accountId: currentCommunity.id, type }) |
| 51 | .then((_) => { |
| 52 | Toast.success('Saved successfully!'); |
| 53 | }) |
| 54 | .catch(() => { |
| 55 | Toast.error('Something went wrong!'); |
| 56 | }); |
| 57 | }} |
| 58 | /> |
| 59 | <hr className={styles.my3} /> |
| 60 | <RemoveCommunity currentCommunity={currentCommunity} api={api} /> |
| 61 | </div> |
| 62 | </div> |
| 63 | ); |
| 64 | } |
nothing calls this directly
no test coverage detected