@@ -20,6 +20,7 @@ import {
2020 EllipsisVerticalIcon ,
2121 PlayIcon ,
2222 Trash2Icon ,
23+ XIcon ,
2324} from "lucide-react" ;
2425
2526import { Img } from "react-image" ;
@@ -34,7 +35,8 @@ interface DowloadedFileProps {
3435 selectedFile ?: string ;
3536 isDeleting ?: string ;
3637 isExpanded : boolean ;
37- onToggleExpand : ( ) => void ;
38+ onToggleExpand : ( ) => void
39+ onCollapse : ( ) => void
3840}
3941
4042export const DowloadedFile : FC < DowloadedFileProps > = ( props ) => {
@@ -46,6 +48,7 @@ export const DowloadedFile: FC<DowloadedFileProps> = (props) => {
4648 isDeleting,
4749 isExpanded,
4850 onToggleExpand,
51+ onCollapse,
4952 } = props ;
5053
5154 const { apiBase } = useApiBase ( ) ;
@@ -121,12 +124,32 @@ export const DowloadedFile: FC<DowloadedFileProps> = (props) => {
121124 </ LongPressButton >
122125 ) ;
123126
124- const MoreButtonControl = ( ) => (
125- < EllipsisVerticalIcon
126- style = { thinIconStyle }
127- onClick = { onToggleExpand }
128- className = { cn ( roundButtonClasses , "cursor-pointer w-10 h-10" ) }
129- />
127+ const ExpandControls = ( ) => (
128+ < EllipsisVerticalIcon
129+ style = { thinIconStyle }
130+ onClick = { onToggleExpand }
131+ className = {
132+ cn (
133+ roundButtonClasses ,
134+ "cursor-pointer w-10 h-10" ,
135+ )
136+ }
137+ />
138+ ) ;
139+
140+ const CollapseControls = ( ) => (
141+ < XIcon
142+ style = { thinIconStyle }
143+ onClick = { onCollapse }
144+ className = {
145+ cn (
146+ roundButtonClasses ,
147+ "cursor-pointer w-10 h-10" ,
148+ 'border-[0.5px] border-foreground' ,
149+ 'hover:bg-foreground/30 transition-colors duration-500'
150+ )
151+ }
152+ />
130153 ) ;
131154
132155 if ( ! isExpanded ) {
@@ -141,7 +164,7 @@ export const DowloadedFile: FC<DowloadedFileProps> = (props) => {
141164 < PlayButtonControl />
142165 < DownloadButtonControl />
143166 < DeleteButtonControl />
144- < MoreButtonControl />
167+ < ExpandControls />
145168 </ div >
146169 </ div >
147170 ) ;
@@ -160,10 +183,9 @@ export const DowloadedFile: FC<DowloadedFileProps> = (props) => {
160183 < PlayButtonControl />
161184 < DownloadButtonControl />
162185 < DeleteButtonControl />
163- < MoreButtonControl /> { /* This now closes it */ }
186+ < CollapseControls />
164187 </ div >
165188 </ div >
166-
167189 </ div >
168190 </ div >
169191 ) ;
0 commit comments