MCPcopy
hub / github.com/marimo-team/marimo / renderUserMessage

Function renderUserMessage

frontend/src/components/chat/chat-panel.tsx:162–195  ·  view source on GitHub ↗
(message: UIMessage)

Source from the content-addressed store, hash-verified

160 addToolApprovalResponse,
161 }) => {
162 const renderUserMessage = (message: UIMessage) => {
163 const textParts = message.parts?.filter(
164 (p): p is TextUIPart => p.type === "text",
165 );
166 const content = textParts?.map((p) => p.text).join("\n");
167 const fileParts = message.parts?.filter(
168 (p): p is FileUIPart => p.type === "file",
169 );
170
171 return (
172 <div className="w-[95%] bg-background border p-1 rounded-sm">
173 {fileParts?.map((filePart, idx) => (
174 <AttachmentRenderer attachment={filePart} key={idx} />
175 ))}
176 <PromptInput
177 key={message.id}
178 value={content}
179 placeholder="Type your message..."
180 onChange={() => {
181 // noop
182 }}
183 onSubmit={(_e, newValue) => {
184 if (!newValue.trim()) {
185 return;
186 }
187 onEdit(index, newValue);
188 }}
189 onClose={() => {
190 // noop
191 }}
192 />
193 </div>
194 );
195 };
196
197 const renderOtherMessage = (message: UIMessage) => {
198 const textParts = message.parts.filter(

Callers 1

chat-panel.tsxFile · 0.85

Calls 3

filterMethod · 0.65
joinMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…