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

Function ChannelView

apps/web/ui/ChannelView/index.tsx:31–917  ·  view source on GitHub ↗
({
  threads,
  topics,
  pinnedThreads: initialPinnedThreads,
  currentChannel: initialChannel,
  currentCommunity,
  settings,
  channelName,
  isSubDomainRouting,
  nextCursor,
  pathCursor,
  isBot,
  permissions,
  setThreads,
  setTopics,
  useUsersContext,
  usePath,
  routerPush,
  api,
  startSignUp,
  selectedThreadId,
}: {
  settings: Settings;
  channelName: string;
  currentChannel: SerializedChannel;
  currentCommunity: SerializedAccount;
  threads: SerializedThread[];
  topics: SerializedTopic[];
  pinnedThreads: SerializedThread[];
  isSubDomainRouting: boolean;
  nextCursor: {
    next: string | null;
    prev: string | null;
  };
  pathCursor: string | null;
  isBot: boolean;
  permissions: Permissions;
  setThreads: React.Dispatch<React.SetStateAction<SerializedThread[]>>;
  setTopics: React.Dispatch<React.SetStateAction<SerializedTopic[]>>;
  useUsersContext: () => [SerializedUser[], any];
  usePath(options: any): any;
  routerPush(path: string): void;
  api: ApiClient;
  startSignUp: (props: StartSignUpProps) => Promise<void>;
  selectedThreadId?: string;
})

Source from the content-addressed store, hash-verified

29const SHORTCUTS_ENABLED = false;
30
31export default function ChannelView({
32 threads,
33 topics,
34 pinnedThreads: initialPinnedThreads,
35 currentChannel: initialChannel,
36 currentCommunity,
37 settings,
38 channelName,
39 isSubDomainRouting,
40 nextCursor,
41 pathCursor,
42 isBot,
43 permissions,
44 setThreads,
45 setTopics,
46 useUsersContext,
47 usePath,
48 routerPush,
49 api,
50 startSignUp,
51 selectedThreadId,
52}: {
53 settings: Settings;
54 channelName: string;
55 currentChannel: SerializedChannel;
56 currentCommunity: SerializedAccount;
57 threads: SerializedThread[];
58 topics: SerializedTopic[];
59 pinnedThreads: SerializedThread[];
60 isSubDomainRouting: boolean;
61 nextCursor: {
62 next: string | null;
63 prev: string | null;
64 };
65 pathCursor: string | null;
66 isBot: boolean;
67 permissions: Permissions;
68 setThreads: React.Dispatch<React.SetStateAction<SerializedThread[]>>;
69 setTopics: React.Dispatch<React.SetStateAction<SerializedTopic[]>>;
70 useUsersContext: () => [SerializedUser[], any];
71 usePath(options: any): any;
72 routerPush(path: string): void;
73 api: ApiClient;
74 startSignUp: (props: StartSignUpProps) => Promise<void>;
75 selectedThreadId?: string;
76}) {
77 const [pinnedThreads, setPinnedThreads] =
78 useState<SerializedThread[]>(initialPinnedThreads);
79 const [currentChannel, setCurrentChannel] = useState(initialChannel);
80 const [allUsers] = useUsersContext();
81
82 const [currentThreadId, setCurrentThreadId] = useState<string | undefined>();
83
84 const debouncedUpserUserThreadStatus = useCallback(
85 debounce(api.upsertUserThreadStatus),
86 []
87 );
88

Callers

nothing calls this directly

Calls 6

useUsersContextFunction · 0.85
debounceFunction · 0.85
useKeyboardFunction · 0.85
infoMethod · 0.65
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected