Spaces:
Running
Running
Download src/components/ResponsiveTable.tsx from fouad12344321/front: direct link, hf CLI and curl.
- Browser
- Download file 975 Bytes
-
https://huggingface.co/spaces/fouad12344321/front/resolve/main/src/components/ResponsiveTable.tsx
- Command line
-
hf download hf://spaces/fouad12344321/front/src/components/ResponsiveTable.tsx
-
curl -L -o ResponsiveTable.tsx https://huggingface.co/spaces/fouad12344321/front/resolve/main/src/components/ResponsiveTable.tsx
975 Bytes
| import { ReactNode } from 'react'; | |
| import { Card } from './ui/card'; | |
| interface ResponsiveTableProps { | |
| children: ReactNode; | |
| className?: string; | |
| } | |
| export function ResponsiveTableWrapper({ children, className = '' }: ResponsiveTableProps) { | |
| return ( | |
| <div className={`overflow-x-auto -mx-4 sm:mx-0 ${className}`}> | |
| <div className="inline-block min-w-full align-middle"> | |
| <div className="overflow-hidden border-b border-gray-200 sm:rounded-lg"> | |
| {children} | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| } | |
| interface MobileCardListProps<T> { | |
| items: T[]; | |
| renderCard: (item: T, index: number) => ReactNode; | |
| className?: string; | |
| } | |
| export function MobileCardList<T>({ items, renderCard, className = '' }: MobileCardListProps<T>) { | |
| return ( | |
| <div className={`space-y-3 ${className}`}> | |
| {items.map((item, index) => ( | |
| <Card key={index} className="p-4"> | |
| {renderCard(item, index)} | |
| </Card> | |
| ))} | |
| </div> | |
| ); | |
| } | |