Skip to content

Commit

Permalink
Use some new types
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Jul 3, 2024
1 parent 304775f commit 980c4f4
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { AccessCode } from '@seamapi/types/connect'
import classNames from 'classnames'
import { DateTime } from 'luxon'
import { useState } from 'react'
import type { AccessCode } from 'seamapi'

import { CopyIcon } from 'lib/icons/Copy.js'
import { useAccessCode } from 'lib/seam/access-codes/use-access-code.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AccessCode } from 'seamapi'
import type { AccessCode } from '@seamapi/types/connect'

import { CheckIcon } from 'lib/icons/Check.js'
import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/seam/components/AccessCodeTable/CodeDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AccessCode } from '@seamapi/types/connect'
import { DateTime } from 'luxon'
import type { AccessCode } from 'seamapi'

import { useDevice } from 'lib/seam/devices/use-device.js'
import { DotDivider } from 'lib/ui/layout/DotDivider.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClimateSettingSchedule } from '@seamapi/types/connect'
import { DateTime } from 'luxon'
import type { ClimateSettingSchedule } from 'seamapi'

import { ClimateSettingScheduleIcon } from 'lib/icons/ClimateSettingSchedule.js'
import { ClimateSettingScheduleDeviceBar } from 'lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ClimateSettingSchedule } from '@seamapi/types/connect'
import { DateTime } from 'luxon'
import type { ClimateSettingSchedule } from 'seamapi'

import { useDevice } from 'lib/seam/devices/use-device.js'
import { DotDivider } from 'lib/ui/layout/DotDivider.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ClimateSettingSchedule } from '@seamapi/types/connect'
import classNames from 'classnames'
import { useCallback, useMemo, useState } from 'react'
import type { ClimateSettingSchedule } from 'seamapi'

import { compareByCreatedAtDesc } from 'lib/dates.js'
import { NestedClimateSettingScheduleDetails } from 'lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { SeamHttpApiError } from '@seamapi/http/connect'
import type { AccessCode } from '@seamapi/types/connect'
import { useState } from 'react'
import type { AccessCode, SeamError } from 'seamapi'

import { useCreateAccessCode } from 'lib/seam/access-codes/use-create-access-code.js'
import {
Expand Down Expand Up @@ -141,15 +142,15 @@ function useSubmitCreateAccessCode(params: {

export function useResponseErrors(): {
responseErrors: ResponseErrors | null
handleResponseError: (error: SeamError) => void
handleResponseError: (error: SeamHttpApiError) => void
resetResponseErrors: () => void
} {
const [responseErrors, setResponseErrors] = useState<Record<
string,
string | undefined
> | null>(null)

const handleResponseError = (error: SeamError): void => {
const handleResponseError = (error: SeamHttpApiError): void => {
const code = getValidationError({ error, property: 'code' })
const name = getValidationError({ error, property: 'name' })

Expand Down
4 changes: 2 additions & 2 deletions src/lib/seam/components/DeviceDetails/DeviceInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CommonDevice } from 'seamapi'
import type { Device } from '@seamapi/types/connect'

import { BeeIcon } from 'lib/icons/Bee.js'
import type { CommonProps } from 'lib/seam/components/common-props.js'
Expand All @@ -13,7 +13,7 @@ interface DeviceInfoProps
'disableConnectedAccountInformation' | 'disableResourceIds'
>
> {
device: CommonDevice
device: Device
}

export function DeviceInfo({
Expand Down
4 changes: 2 additions & 2 deletions src/lib/seam/components/DeviceDetails/DeviceModel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CommonDevice } from 'seamapi'
import type { Device } from '@seamapi/types/connect'

interface DeviceModelProps {
device: CommonDevice
device: Device
}

export function DeviceModel({ device }: DeviceModelProps): JSX.Element | null {
Expand Down

0 comments on commit 980c4f4

Please sign in to comment.