useSelectedVectorBuckets.ts16 lines · main
| 1 | import { useParams } from 'common' |
| 2 | |
| 3 | import { useVectorBucketsQuery } from '@/data/storage/vector-buckets-query' |
| 4 | |
| 5 | export const useSelectedVectorBucket = () => { |
| 6 | const { ref: projectRef, bucketId } = useParams() |
| 7 | |
| 8 | return useVectorBucketsQuery( |
| 9 | { projectRef }, |
| 10 | { |
| 11 | select(data) { |
| 12 | return data.vectorBuckets.find((x) => x.vectorBucketName === bucketId) |
| 13 | }, |
| 14 | } |
| 15 | ) |
| 16 | } |