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

Function Channel

apps/web/ui/ChannelView/ChatView/index.tsx:142–619  ·  view source on GitHub ↗
({
  threads,
  pinnedThreads,
  currentChannel,
  currentCommunity,
  settings,
  channelName,
  isSubDomainRouting,
  nextCursor,
  token,
  permissions,
  currentThreadId,
  pathCursor,
  setThreads,
  deleteMessage,
  editThread,
  muteThread,
  unmuteThread,
  pinThread,
  starThread,
  updateThreadResolution,
  readThread,
  unreadThread,
  editMessage,
  onMessage,
  onDrop,
  onShare,
  onRemind,
  onSelectThread,
  updateThread,
  sendReaction,
  useUsersContext,
  usePath,
  routerPush,
  api,
  startSignUp,
  activeUsers,
}: Props)

Source from the content-addressed store, hash-verified

140const UPDATE_READ_STATUS_INTERVAL_IN_MS = 30000;
141
142export default function Channel({
143 threads,
144 pinnedThreads,
145 currentChannel,
146 currentCommunity,
147 settings,
148 channelName,
149 isSubDomainRouting,
150 nextCursor,
151 token,
152 permissions,
153 currentThreadId,
154 pathCursor,
155 setThreads,
156 deleteMessage,
157 editThread,
158 muteThread,
159 unmuteThread,
160 pinThread,
161 starThread,
162 updateThreadResolution,
163 readThread,
164 unreadThread,
165 editMessage,
166 onMessage,
167 onDrop,
168 onShare,
169 onRemind,
170 onSelectThread,
171 updateThread,
172 sendReaction,
173 useUsersContext,
174 usePath,
175 routerPush,
176 api,
177 startSignUp,
178 activeUsers,
179}: Props) {
180 const [collapsed, setCollapsed] = useState(false);
181 const [isInfiniteScrollLoading, setInfiniteScrollLoading] = useState(false);
182 const [isLeftScrollAtBottom, setIsLeftScrollAtBottom] = useState(true);
183 const [isScrolling, setIsScrolling] = useState(true);
184 const [readStatus, setReadStatus] = useState<SerializedReadStatus>();
185 const scrollableRootRef = useRef<HTMLDivElement | null>(null);
186 const lastScrollDistanceToBottomRef = useRef<number>();
187 const rightRef = useRef<HTMLDivElement>(null);
188 const leftBottomRef = useRef<HTMLDivElement>(null);
189 const [cursor, setCursor] = useState(nextCursor);
190 const [error, setError] = useState<{ prev?: unknown; next?: unknown }>();
191 const [progress, setProgress] = useState(0);
192 const [uploading, setUploading] = useState(false);
193 const [uploads, setUploads] = useState<UploadedFile[]>([]);
194 const [allUsers] = useUsersContext();
195 const { mode } = useMode();
196 const [editedMessage, setEditedMessage] = useState<SerializedMessage>();
197 const [editedThread, setEditedThread] = useState<SerializedThread>();
198 const membersPath = usePath({ href: '/members' });
199 const viewport = useViewport();

Callers

nothing calls this directly

Calls 15

useViewportFunction · 0.90
timestampFunction · 0.90
createMessageWrapperFunction · 0.90
useUsersContextFunction · 0.85
useModeFunction · 0.85
usePathFunction · 0.85
debounceFunction · 0.85
onSelectThreadFunction · 0.85
scrollDownFunction · 0.70
handleScrollFunction · 0.70
uploadFilesFunction · 0.70
selectThreadFunction · 0.70

Tested by

no test coverage detected