import { FilesBucket as FilesBucketIcon } from 'icons' import { ChevronRight } from 'lucide-react' import { Card, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from 'ui' const buckets = [ { id: 'avatars', name: 'avatars', updated: '2 hours ago', }, { id: 'listing-photos', name: 'listing-photos', updated: '1 day ago', }, { id: 'documents', name: 'documents', updated: '3 days ago', }, ] // Studio: See also createNavigationHandler in apps/studio/lib/navigation.ts // It handles all of the below, plus modifier clicks and middle mouse button clicks. const handleBucketNavigation = ( bucketId: string, event: React.MouseEvent | React.KeyboardEvent ) => { const url = `/${bucketId}` if (event.metaKey || event.ctrlKey) { // window.open(`${url}`, '_blank') Disabled for demo purposes } else { // router.push(url) Disabled for demo purposes } } export default function TableRowLink() { return ( Icon Name Updated Actions {buckets.map((bucket) => ( { if (event.currentTarget !== event.target) return handleBucketNavigation(bucket.id, event) }} onKeyDown={(event) => { if (event.currentTarget !== event.target) return if (event.key === 'Enter' || event.key === ' ') { event.preventDefault() handleBucketNavigation(bucket.id, event) } }} tabIndex={0} > {bucket.name} {bucket.updated}
))}
) }