Skip to content

Commit 8665901

Browse files
committed
fix(org): pick Mothership's time range with the design system's date control
1 parent 748da9f commit 8665901

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎apps/sim/platform/embedded/app/(shell)/settings/_components/sections/mothership/mothership-section.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
Button,
2929
CopyField,
3030
DataTable,
31+
DateRangePicker,
3132
EmptyState,
3233
InlineNotice,
3334
LoadingRows,
@@ -60,8 +61,8 @@ export default function MothershipSection() {
6061
mothershipUrlKeys
6162
)
6263
const defaults = defaultTimeRange()
63-
const [start, setStart] = useState(defaults.start)
64-
const [end, setEnd] = useState(defaults.end)
64+
const [range, setRange] = useState(defaults)
65+
const { start, end } = range
6566
const requestLeave = useSettingsDirtyStore((state) => state.requestLeave)
6667
return (
6768
<SectionStack>
@@ -75,8 +76,14 @@ export default function MothershipSection() {
7576
requestLeave(() => void setParams({ env: value as MothershipEnv }))
7677
}}
7778
/>
78-
<TextField label='From' type='datetime-local' value={start} onChange={setStart} />
79-
<TextField label='To' type='datetime-local' value={end} onChange={setEnd} />
79+
<DateRangePicker
80+
label='Time range'
81+
withTime
82+
value={range}
83+
onValueChange={(next) => {
84+
if (next) setRange(next)
85+
}}
86+
/>
8087
</SectionToolbar>
8188
<ActionRow>
8289
<SegmentedControl

0 commit comments

Comments
 (0)