MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / ConfigurationsView

Function ConfigurationsView

apps/web/ui/ConfigurationsView/index.tsx:16–64  ·  view source on GitHub ↗
({
  currentCommunity,
  api,
}: {
  currentCommunity: SerializedAccount;
  api: ApiClient;
})

Source from the content-addressed store, hash-verified

14import type { ApiClient } from '@linen/api-client';
15
16export 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}

Callers

nothing calls this directly

Calls 4

debounceFunction · 0.85
successMethod · 0.80
errorMethod · 0.65
updateAccountFunction · 0.50

Tested by

no test coverage detected