File tree Expand file tree Collapse file tree
protocol-visualization/src
molecules/SlotDetailsEmptyState Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export { AnnotatedSteps } from './organisms/AnnotatedSteps'
1111
1212export type { GroupedCommands , LeafNode } from './types'
1313
14+ export { SlotDetailsEmptyState } from './molecules/SlotDetailsEmptyState'
15+
1416/**
1517 * Package identifier string (useful for diagnostics or feature flags).
1618 */
Original file line number Diff line number Diff line change 1+ import { screen } from '@testing-library/react'
2+ import { beforeEach , describe , it } from 'vitest'
3+
4+ import { SlotDetailsEmptyState } from '..'
5+ import { renderWithProviders } from '../../../__testing-utils__'
6+
7+ import type { ComponentProps } from 'react'
8+
9+ const render = ( props : ComponentProps < typeof SlotDetailsEmptyState > ) => {
10+ return renderWithProviders ( < SlotDetailsEmptyState { ...props } /> ) // TODO: add i18n rendering option
11+ }
12+
13+ describe ( 'SlotDetailsEmptyState' , ( ) => {
14+ let props : ComponentProps < typeof SlotDetailsEmptyState >
15+
16+ beforeEach ( ( ) => {
17+ props = {
18+ slotId : 'A1' ,
19+ }
20+ } )
21+
22+ it ( 'should render slot empty state' , ( ) => {
23+ render ( props )
24+ screen . getByText ( 'A1' )
25+ screen . getByText ( 'slot_empty' )
26+ } )
27+ } )
Original file line number Diff line number Diff line change 1+ import { useTranslation } from 'react-i18next'
2+
3+ import { COLORS , RobotInfoLabel , StyledText } from '@opentrons/components'
4+
5+ import styles from './slotdetailsemptystate.module.css'
6+
7+ interface SlotDetailsEmptyStateProps {
8+ slotId : string
9+ }
10+
11+ export function SlotDetailsEmptyState (
12+ props : SlotDetailsEmptyStateProps
13+ ) : JSX . Element {
14+ const { slotId } = props
15+ const { t } = useTranslation ( 'protocol_visualization' )
16+ return (
17+ < div className = { styles . slot_empty_container } >
18+ < div className = { styles . slot_empty_header } >
19+ < RobotInfoLabel deckLabel = { slotId } />
20+ </ div >
21+ < div className = { styles . slot_empty_body } >
22+ < StyledText desktopStyle = "bodyDefaultRegular" color = { COLORS . grey50 } >
23+ { t ( 'slot_empty' ) }
24+ </ StyledText >
25+ </ div >
26+ </ div >
27+ )
28+ }
Original file line number Diff line number Diff line change 1+ .slot_empty_container {
2+ display : flex;
3+ width : 100% ;
4+ height : 100% ;
5+ flex-direction : column;
6+ gap : var (--spacing-16 );
7+ }
8+
9+ .slot_empty_header {
10+ display : flex;
11+ width : 100% ;
12+ justify-content : flex-start;
13+ }
14+
15+ .slot_empty_body {
16+ display : flex;
17+ width : 100% ;
18+ height : 100% ;
19+ align-items : center;
20+ justify-content : center;
21+ padding : var (--spacing-16 ) var (--spacing-24 );
22+ border-radius : var (--border-radius-4 );
23+ background-color : var (--grey-10 );
24+ }
You can’t perform that action at this time.
0 commit comments