Skip to content

Commit e1e0497

Browse files
committed
styles: add table for code performance component
1 parent 7ff1817 commit e1e0497

File tree

1 file changed

+28
-25
lines changed

1 file changed

+28
-25
lines changed

src/components/pages/home/client.tsx

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { api } from '@/client/trpc';
66
import { Button } from '@/components/ui/button';
77
import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area';
88
import { Skeleton } from '@/components/ui/skeleton';
9+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
910
import { Textarea } from '@/components/ui/textarea';
1011
import { languageOptions } from '@/constants/app';
1112
import { cn } from '@/lib/utils/cn';
@@ -171,32 +172,34 @@ export function OutputDetails() {
171172

172173
if (!output.status || !output.memory || !output.time) return null;
173174

174-
if (processing)
175-
return (
176-
<div className='text-sm text-muted-foreground mt-3 space-y-1'>
177-
<div className='flex items-center justify-start gap-3'>
178-
Status: <Skeleton className='h-4 w-20' />
179-
</div>
180-
<div className='flex items-center justify-start gap-3'>
181-
Memory: <Skeleton className='h-4 w-20' />
182-
</div>
183-
<div className='flex items-center justify-start gap-3'>
184-
Time: <Skeleton className='h-4 w-20' />
185-
</div>
186-
</div>
187-
);
188-
189175
return (
190-
<div className='text-sm text-muted-foreground mt-3 space-y-1'>
191-
<p>
192-
Status: <span className='font-medium'>{output.status.description}</span>
193-
</p>
194-
<p>
195-
Memory: <span className='font-medium'>{output.memory}</span>
196-
</p>
197-
<p>
198-
Time: <span className='font-medium'>{output.time}</span>
199-
</p>
176+
<div className='text-muted-foreground mt-3 border rounded-lg overflow-hidden'>
177+
<Table className='table-fixed'>
178+
<TableHeader>
179+
<TableRow className='bg-muted/50 text-sm'>
180+
<TableHead className='text-center'>Performance</TableHead>
181+
<TableHead className='text-center'>Result</TableHead>
182+
</TableRow>
183+
</TableHeader>
184+
<TableBody className='text-xs'>
185+
<TableRow>
186+
<TableCell className='text-center p-3'>Status</TableCell>
187+
<TableCell className='font-medium text-center p-3'>
188+
{processing ? <Skeleton className='h-4 w-20 mx-auto' /> : output.status.description}
189+
</TableCell>
190+
</TableRow>
191+
<TableRow>
192+
<TableCell className='text-center p-3'>Memory</TableCell>
193+
<TableCell className='font-medium text-center p-3 justify-center'>
194+
{processing ? <Skeleton className='h-4 w-20 mx-auto' /> : output.memory}
195+
</TableCell>
196+
</TableRow>
197+
<TableRow>
198+
<TableCell className='text-center p-3'>Time</TableCell>
199+
<TableCell className='font-medium text-center p-3'>{processing ? <Skeleton className='h-4 w-20 mx-auto' /> : output.time}</TableCell>
200+
</TableRow>
201+
</TableBody>
202+
</Table>
200203
</div>
201204
);
202205
}

0 commit comments

Comments
 (0)