@@ -152,7 +152,7 @@ export function PromptInputProvider({
152152 const clearInput = useCallback ( ( ) => setTextInput ( "" ) , [ ] ) ;
153153
154154 // ----- attachments state (global when wrapped)
155- const [ attachements , setAttachements ] = useState <
155+ const [ attachments , setAttachments ] = useState <
156156 ( FileUIPart & { id : string } ) [ ]
157157 > ( [ ] ) ;
158158 const fileInputRef = useRef < HTMLInputElement | null > ( null ) ;
@@ -164,7 +164,7 @@ export function PromptInputProvider({
164164 return ;
165165 }
166166
167- setAttachements ( ( prev ) =>
167+ setAttachments ( ( prev ) =>
168168 prev . concat (
169169 incoming . map ( ( file ) => ( {
170170 id : nanoid ( ) ,
@@ -178,7 +178,7 @@ export function PromptInputProvider({
178178 } , [ ] ) ;
179179
180180 const remove = useCallback ( ( id : string ) => {
181- setAttachements ( ( prev ) => {
181+ setAttachments ( ( prev ) => {
182182 const found = prev . find ( ( f ) => f . id === id ) ;
183183 if ( found ?. url ) {
184184 URL . revokeObjectURL ( found . url ) ;
@@ -188,7 +188,7 @@ export function PromptInputProvider({
188188 } , [ ] ) ;
189189
190190 const clear = useCallback ( ( ) => {
191- setAttachements ( ( prev ) => {
191+ setAttachments ( ( prev ) => {
192192 for ( const f of prev ) {
193193 if ( f . url ) {
194194 URL . revokeObjectURL ( f . url ) ;
@@ -202,16 +202,16 @@ export function PromptInputProvider({
202202 openRef . current ?.( ) ;
203203 } , [ ] ) ;
204204
205- const attachments = useMemo < AttachmentsContext > (
205+ const attachmentsContext = useMemo < AttachmentsContext > (
206206 ( ) => ( {
207- files : attachements ,
207+ files : attachments ,
208208 add,
209209 remove,
210210 clear,
211211 openFileDialog,
212212 fileInputRef,
213213 } ) ,
214- [ attachements , add , remove , clear , openFileDialog ] ,
214+ [ attachments , add , remove , clear , openFileDialog ] ,
215215 ) ;
216216
217217 const __registerFileInput = useCallback (
@@ -237,7 +237,7 @@ export function PromptInputProvider({
237237
238238 return (
239239 < PromptInputController . Provider value = { controller } >
240- < ProviderAttachmentsContext . Provider value = { attachments } >
240+ < ProviderAttachmentsContext . Provider value = { attachmentsContext } >
241241 { children }
242242 </ ProviderAttachmentsContext . Provider >
243243 </ PromptInputController . Provider >
0 commit comments