EmptyBucketState.tsx30 lines · main
| 1 | import { BucketPlus } from 'icons' |
| 2 | import { EmptyStatePresentational } from 'ui-patterns' |
| 3 | |
| 4 | import { CreateBucketButton } from './NewBucketButton' |
| 5 | import { BUCKET_TYPES } from './Storage.constants' |
| 6 | |
| 7 | interface EmptyBucketStateProps { |
| 8 | bucketType: keyof typeof BUCKET_TYPES |
| 9 | className?: string |
| 10 | onCreateBucket: () => void |
| 11 | } |
| 12 | |
| 13 | export const EmptyBucketState = ({ |
| 14 | bucketType, |
| 15 | className, |
| 16 | onCreateBucket, |
| 17 | }: EmptyBucketStateProps) => { |
| 18 | const config = BUCKET_TYPES[bucketType] |
| 19 | |
| 20 | return ( |
| 21 | <EmptyStatePresentational |
| 22 | icon={BucketPlus} |
| 23 | title={`Create ${config.article} ${config.singularName} bucket`} |
| 24 | description={config.valueProp} |
| 25 | className={className} |
| 26 | > |
| 27 | <CreateBucketButton onClick={onCreateBucket} /> |
| 28 | </EmptyStatePresentational> |
| 29 | ) |
| 30 | } |