Skip to content

Commit a0bfe2d

Browse files
committed
improvement(tables): improve timezone loading state
1 parent b80c4df commit a0bfe2d

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/inline-editors.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ describe('dateEditorRawValue', () => {
120120

121121
act(() => root.render(createElement(InlineEditor, props)))
122122

123-
expect(container.querySelector('input')).toMatchObject({
124-
disabled: true,
125-
placeholder: 'Loading timezone...',
126-
})
123+
expect(container.querySelector('input')).toBeNull()
124+
expect(container.querySelector('[role="status"]')?.textContent).toBe('Loading timezone…')
127125

128126
mockUseTimezoneState.mockReturnValue({
129127
timezone: 'America/Los_Angeles',

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/inline-editors.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,9 @@ function InlineDateEditor(props: InlineEditorProps) {
8181

8282
if (ttlTimezoneUnavailable) {
8383
return (
84-
<input
85-
type='text'
86-
value=''
87-
disabled
88-
placeholder={
89-
timezoneState.status === 'error' ? 'Timezone unavailable' : 'Loading timezone...'
90-
}
91-
className='w-full min-w-0 border-none bg-transparent p-0 text-[var(--text-muted)] text-small outline-none'
92-
/>
84+
<span role='status' className='w-full min-w-0 truncate text-[var(--text-muted)] text-small'>
85+
{timezoneState.status === 'error' ? 'Timezone unavailable' : 'Loading timezone…'}
86+
</span>
9387
)
9488
}
9589

0 commit comments

Comments
 (0)