@@ -11,9 +11,10 @@ import {
1111 TableHeader ,
1212 TableRow ,
1313} from "@/components/ui/table" ;
14- import { useIndex } from "@/hooks/nginx-index " ;
14+ import { useIndex } from "@/hooks/nginx" ;
1515import { getFileIcon , sortFiles } from "@/lib/client/utils" ;
1616import type { SortColumn , SortDirection } from "@/types/files" ;
17+ import { Wrapper } from "./wrapper" ;
1718
1819export const FileTable : React . FC = ( ) => {
1920 const { t } = useTranslation ( ) ;
@@ -59,74 +60,76 @@ export const FileTable: React.FC = () => {
5960 } ;
6061
6162 return (
62- < div className = "rounded-md overflow-hidden" >
63- < Table >
64- < TableHeader >
65- < TableRow >
66- < TableHead className = "w-full" >
67- < Button
68- variant = "ghost"
69- size = "sm"
70- onClick = { ( ) => toggleSort ( "name" ) }
71- >
72- { t ( "fileExplorer.name" ) }
73- < SortIcon column = "name" />
74- </ Button >
75- </ TableHead >
63+ < Wrapper >
64+ < div className = "rounded-md overflow-hidden" >
65+ < Table >
66+ < TableHeader >
67+ < TableRow >
68+ < TableHead className = "w-full" >
69+ < Button
70+ variant = "ghost"
71+ size = "sm"
72+ onClick = { ( ) => toggleSort ( "name" ) }
73+ >
74+ { t ( "fileExplorer.name" ) }
75+ < SortIcon column = "name" />
76+ </ Button >
77+ </ TableHead >
7678
77- < TableHead className = "text-right whitespace-nowrap w-min" >
78- < Button
79- variant = "ghost"
80- size = "sm"
81- onClick = { ( ) => toggleSort ( "size" ) }
82- >
83- { t ( "fileExplorer.size" ) }
84- < SortIcon column = "size" />
85- </ Button >
86- </ TableHead >
79+ < TableHead className = "text-right whitespace-nowrap w-min" >
80+ < Button
81+ variant = "ghost"
82+ size = "sm"
83+ onClick = { ( ) => toggleSort ( "size" ) }
84+ >
85+ { t ( "fileExplorer.size" ) }
86+ < SortIcon column = "size" />
87+ </ Button >
88+ </ TableHead >
8789
88- < TableHead className = "text-right whitespace-nowrap w-min" >
89- < Button
90- variant = "ghost"
91- size = "sm"
92- onClick = { ( ) => toggleSort ( "date" ) }
93- >
94- { t ( "fileExplorer.modified" ) }
95- < SortIcon column = "date" />
96- </ Button >
97- </ TableHead >
98- </ TableRow >
99- </ TableHeader >
100- < TableBody >
101- { sortedFiles . map ( ( file ) => {
102- const Icon = getFileIcon ( file . name , file . isDirectory ) ;
103- return (
104- < TableRow key = { file . link } >
105- < TableCell className = "font-medium" >
106- < a href = { file . link } className = "flex items-center gap-2" >
107- < Icon className = "h-4 w-4" />
108- { file . name . replace ( / \/ + $ / , "" ) }
109- </ a >
110- </ TableCell >
90+ < TableHead className = "text-right whitespace-nowrap w-min" >
91+ < Button
92+ variant = "ghost"
93+ size = "sm"
94+ onClick = { ( ) => toggleSort ( "date" ) }
95+ >
96+ { t ( "fileExplorer.modified" ) }
97+ < SortIcon column = "date" />
98+ </ Button >
99+ </ TableHead >
100+ </ TableRow >
101+ </ TableHeader >
102+ < TableBody >
103+ { sortedFiles . map ( ( file ) => {
104+ const Icon = getFileIcon ( file . name , file . isDirectory ) ;
105+ return (
106+ < TableRow key = { file . link } >
107+ < TableCell className = "font-medium" >
108+ < a href = { file . link } className = "flex items-center gap-2" >
109+ < Icon className = "h-4 w-4" />
110+ { file . name . replace ( / \/ + $ / , "" ) }
111+ </ a >
112+ </ TableCell >
111113
112- < TableCell className = "text-right" >
113- { ! file . isDirectory && file . size ? (
114- < Badge variant = "secondary" className = "inline-flex" >
115- { file . size . raw }
116- </ Badge >
117- ) : (
118- "-"
119- ) }
120- </ TableCell >
114+ < TableCell className = "text-right" >
115+ { ! file . isDirectory && file . size ? (
116+ < Badge variant = "secondary" className = "inline-flex" >
117+ { file . size . raw }
118+ </ Badge >
119+ ) : (
120+ "-"
121+ ) }
122+ </ TableCell >
121123
122- < TableCell className = "text-right whitespace-nowrap font-mono pr-5 text-xs" >
123- { formatDate ( file . date ) }
124- </ TableCell >
125- </ TableRow >
126- ) ;
127- } ) }
128- </ TableBody >
129- </ Table >
130- </ div >
124+ < TableCell className = "text-right whitespace-nowrap font-mono pr-5 text-xs" >
125+ { formatDate ( file . date ) }
126+ </ TableCell >
127+ </ TableRow >
128+ ) ;
129+ } ) }
130+ </ TableBody >
131+ </ Table >
132+ </ div >
133+ </ Wrapper >
131134 ) ;
132135} ;
0 commit comments