useSelectedBucket.ts19 lines · main
| 1 | import { useParams } from 'common' |
| 2 | |
| 3 | import { useBucketQuery } from '@/data/storage/buckets-query' |
| 4 | |
| 5 | export const useSelectedBucket = () => { |
| 6 | const { ref, bucketId } = useParams() |
| 7 | |
| 8 | const query = useBucketQuery( |
| 9 | { |
| 10 | projectRef: ref, |
| 11 | bucketId, |
| 12 | }, |
| 13 | { |
| 14 | enabled: !!bucketId, |
| 15 | } |
| 16 | ) |
| 17 | |
| 18 | return query |
| 19 | } |