@seamapi/react 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/elements.js +25043 -0
- package/dist/elements.js.map +1 -0
- package/hooks.d.ts +1 -0
- package/hooks.js +2 -0
- package/hooks.js.map +1 -0
- package/index.css +6 -0
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/{sort-by.d.ts → dates.d.ts} +1 -1
- package/lib/{sort-by.js → dates.js} +2 -2
- package/lib/dates.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/{SeamProvider.d.ts → seam/SeamProvider.d.ts} +9 -6
- package/lib/{SeamProvider.js → seam/SeamProvider.js} +29 -30
- package/lib/seam/SeamProvider.js.map +1 -0
- package/lib/seam/access-codes/use-access-codes.js +2 -2
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.d.ts +2 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.js +9 -8
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.js +7 -7
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +7 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +77 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.js +3 -3
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +7 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +80 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceModel.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.d.ts +3 -2
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.js +4 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.d.ts +1 -1
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.js +9 -9
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -0
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +9 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js +66 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +20 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.js +8 -5
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +9 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +39 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +9 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.js +33 -28
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.d.ts +2 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js +12 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +19 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +17 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +7 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +18 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -0
- package/lib/seam/components/index.js.map +1 -0
- package/lib/seam/device-models/use-device-models.d.ts +5 -0
- package/lib/seam/device-models/use-device-models.js +17 -0
- package/lib/seam/device-models/use-device-models.js.map +1 -0
- package/lib/seam/devices/use-devices.js +3 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/devices/use-toggle-lock.js +1 -1
- package/lib/seam/devices/use-toggle-lock.js.map +1 -1
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/use-seam-client.js +1 -1
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-font.d.ts +1 -1
- package/lib/seam/use-seam-font.js +1 -1
- package/lib/seam/use-seam-font.js.map +1 -1
- package/lib/seam/use-seam-styles.js.map +1 -1
- package/lib/{capitalize.js → strings.js} +1 -1
- package/lib/strings.js.map +1 -0
- package/lib/ui/Menu/Menu.d.ts +1 -1
- package/lib/ui/Menu/Menu.js.map +1 -1
- package/lib/ui/Menu/MenuItem.d.ts +1 -1
- package/lib/ui/Menu/MoreActionsMenu.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +2 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +2 -1
- package/lib/ui/TextField/SearchTextField.js.map +1 -1
- package/lib/{copy-to-clipboard.js → ui/clipboard.js} +1 -1
- package/lib/ui/clipboard.js.map +1 -0
- package/lib/ui/use-interval.js.map +1 -0
- package/lib/{use-is-date-in-past.js → ui/use-is-date-in-past.js} +1 -1
- package/lib/ui/use-is-date-in-past.js.map +1 -0
- package/lib/ui/use-toggle.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +3 -1
- package/lib/version.js.map +1 -1
- package/package.json +21 -8
- package/src/elements.ts +27 -0
- package/src/hooks.ts +1 -0
- package/src/lib/{sort-by.ts → dates.ts} +1 -1
- package/src/lib/element.tsx +86 -0
- package/src/lib/index.ts +2 -2
- package/src/lib/{SeamProvider.tsx → seam/SeamProvider.tsx} +53 -46
- package/src/lib/seam/access-codes/use-access-codes.ts +2 -2
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.tsx +9 -6
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.tsx +2 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeTable/AccessCodeTable.tsx +30 -11
- package/src/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.tsx +2 -3
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.tsx +22 -12
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.tsx +1 -1
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceRow.tsx +1 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.element.ts +11 -0
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceTable.tsx +15 -12
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.tsx +26 -13
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +120 -0
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +43 -39
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.tsx +22 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +11 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +35 -0
- package/src/lib/seam/components/elements.ts +5 -0
- package/src/lib/seam/device-models/use-device-models.ts +34 -0
- package/src/lib/seam/devices/use-devices.ts +3 -3
- package/src/lib/seam/devices/use-toggle-lock.ts +1 -2
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/use-seam-client.ts +1 -1
- package/src/lib/seam/use-seam-font.ts +5 -1
- package/src/lib/seam/use-seam-styles.ts +1 -1
- package/src/lib/ui/Menu/Menu.tsx +4 -4
- package/src/lib/ui/Menu/MenuItem.tsx +1 -1
- package/src/lib/ui/Menu/MoreActionsMenu.tsx +1 -1
- package/src/lib/ui/Table/TableFilterBar/TableFilterBar.tsx +2 -2
- package/src/lib/ui/Table/TableFilterBar/TableFilterItem.tsx +1 -1
- package/src/lib/ui/TextField/SearchTextField.tsx +3 -3
- package/src/lib/ui/clipboard.ts +3 -0
- package/src/lib/{use-interval.ts → ui/use-interval.ts} +1 -1
- package/src/lib/{use-is-date-in-past.ts → ui/use-is-date-in-past.ts} +1 -1
- package/src/lib/version.ts +3 -1
- package/src/styles/_access-code-table.scss +7 -0
- package/lib/SeamProvider.js.map +0 -1
- package/lib/capitalize.js.map +0 -1
- package/lib/copy-to-clipboard.js.map +0 -1
- package/lib/sort-by.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js.map +0 -1
- package/lib/ui/AccessCodeTable/AccessCodeTable.d.ts +0 -6
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +0 -69
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +0 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceDetails.d.ts +0 -6
- package/lib/ui/DeviceDetails/DeviceDetails.js +0 -80
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceModel.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceHealthBar.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceRow.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceTable.d.ts +0 -8
- package/lib/ui/DeviceTable/DeviceTable.js +0 -65
- package/lib/ui/DeviceTable/DeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -4
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +0 -46
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -11
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js +0 -12
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -3
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +0 -8
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/types.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/types.js +0 -2
- package/lib/ui/SupportedDeviceTable/types.js.map +0 -1
- package/lib/ui/index.js.map +0 -1
- package/lib/use-interval.js.map +0 -1
- package/lib/use-is-date-in-past.js.map +0 -1
- package/lib/use-toggle.js.map +0 -1
- package/src/lib/copy-to-clipboard.ts +0 -3
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -135
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.tsx +0 -14
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -35
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -16
- package/src/lib/ui/SupportedDeviceTable/types.ts +0 -16
- /package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.js +0 -0
- /package/lib/{ui → seam/components}/index.d.ts +0 -0
- /package/lib/{ui → seam/components}/index.js +0 -0
- /package/lib/{capitalize.d.ts → strings.d.ts} +0 -0
- /package/lib/{copy-to-clipboard.d.ts → ui/clipboard.d.ts} +0 -0
- /package/lib/{use-interval.d.ts → ui/use-interval.d.ts} +0 -0
- /package/lib/{use-interval.js → ui/use-interval.js} +0 -0
- /package/lib/{use-is-date-in-past.d.ts → ui/use-is-date-in-past.d.ts} +0 -0
- /package/lib/{use-toggle.d.ts → ui/use-toggle.d.ts} +0 -0
- /package/lib/{use-toggle.js → ui/use-toggle.js} +0 -0
- /package/src/lib/{ui → seam/components}/DeviceDetails/DeviceModel.tsx +0 -0
- /package/src/lib/{ui → seam/components}/index.ts +0 -0
- /package/src/lib/{capitalize.ts → strings.ts} +0 -0
- /package/src/lib/{use-toggle.ts → ui/use-toggle.ts} +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface DeviceModel {
|
|
2
|
-
main_category: string;
|
|
3
|
-
model_name: string;
|
|
4
|
-
manufacturer_model_id: string;
|
|
5
|
-
connection_type: string;
|
|
6
|
-
support_level: 'Live' | 'Beta' | 'Unsupported';
|
|
7
|
-
brand: string;
|
|
8
|
-
icon_url: string;
|
|
9
|
-
seam_device_model_page_url: string;
|
|
10
|
-
}
|
|
11
|
-
export interface Filters {
|
|
12
|
-
supportedOnly: boolean;
|
|
13
|
-
category: string | null;
|
|
14
|
-
brand: string | null;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/ui/SupportedDeviceTable/types.ts"],"names":[],"mappings":""}
|
package/lib/ui/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA;AACpD,cAAc,kCAAkC,CAAA;AAChD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,gDAAgD,CAAA"}
|
package/lib/use-interval.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-interval.js","sourceRoot":"","sources":["../src/lib/use-interval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAA;AAE3E,MAAM,UAAU,WAAW,CACzB,QAAoB,EACpB,QAAgB,YAAY;IAE5B,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,QAAQ,EAAE,CAAA;IACZ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACnD,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACjC,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-date-in-past.js","sourceRoot":"","sources":["../src/lib/use-is-date-in-past.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,UAAU,eAAe,CAC7B,IAA+B;IAE/B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC,CAAA;IAEtE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,IAAI,IAAI,IAAI,IAAI;YAAE,OAAM;QACxB,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3B,WAAW,CAAC,MAAM,CAAC,CAAA;IAEnB,OAAO,YAAY,CAAA;AACrB,CAAC;AAED,MAAM,QAAQ,GAAG,CAAC,EAAY,EAAkB,EAAE;IAChD,IAAI,CAAC,EAAE,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAC5B,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,YAAY,GAAG,CAAC,CAAA;AACtC,CAAC,CAAA"}
|
package/lib/use-toggle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-toggle.js","sourceRoot":"","sources":["../src/lib/use-toggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,eAAwB,KAAK,EACN,EAAE;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;IAElD,uEAAuE;IAEvE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IAChC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACzB,CAAC,CAAA"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
import { useState } from 'react'
|
|
3
|
-
|
|
4
|
-
import { Button } from 'lib/ui/Button.js'
|
|
5
|
-
import { SupportedDeviceFilterArea } from 'lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js'
|
|
6
|
-
import type { DeviceModel, Filters } from 'lib/ui/SupportedDeviceTable/types.js'
|
|
7
|
-
|
|
8
|
-
import { SupportedDeviceHeader } from './SupportedDeviceHeader.js'
|
|
9
|
-
import { SupportedDeviceRow } from './SupportedDeviceRow.js'
|
|
10
|
-
|
|
11
|
-
export interface SupportedDeviceContentProps {
|
|
12
|
-
cannotFilter?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function SupportedDeviceContent({
|
|
16
|
-
cannotFilter = false,
|
|
17
|
-
}: SupportedDeviceContentProps) {
|
|
18
|
-
const [filterValue, setFilterValue] = useState('')
|
|
19
|
-
const [filters, setFilters] = useState<Filters>({
|
|
20
|
-
supportedOnly: false,
|
|
21
|
-
category: null,
|
|
22
|
-
brand: null,
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
data: deviceModels,
|
|
27
|
-
isLoading,
|
|
28
|
-
isError,
|
|
29
|
-
refetch,
|
|
30
|
-
} = useQuery<DeviceModel[]>({
|
|
31
|
-
queryKey: ['supported_devices', filterValue, filters],
|
|
32
|
-
queryFn: async () => {
|
|
33
|
-
const url = new URL('https://devicedb.seam.co/api/device_models/list')
|
|
34
|
-
|
|
35
|
-
if (filterValue.trim() !== '') {
|
|
36
|
-
url.searchParams.set('text_search', filterValue.trim())
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (filters.supportedOnly) {
|
|
40
|
-
url.searchParams.set('support_level', 'live')
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (filters.category !== null) {
|
|
44
|
-
url.searchParams.set('main_category', filters.category)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (filters.brand !== null) {
|
|
48
|
-
url.searchParams.set('brand', filters.brand)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const res = await fetch(url)
|
|
52
|
-
if (!res.ok) {
|
|
53
|
-
throw new Error('Failed to load device models')
|
|
54
|
-
}
|
|
55
|
-
const data = await res.json()
|
|
56
|
-
return data?.device_models ?? []
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div className='seam-supported-device-table-content-wrap'>
|
|
62
|
-
{!cannotFilter && (
|
|
63
|
-
<SupportedDeviceFilterArea
|
|
64
|
-
deviceModels={deviceModels ?? []}
|
|
65
|
-
filterValue={filterValue}
|
|
66
|
-
setFilterValue={setFilterValue}
|
|
67
|
-
filters={filters}
|
|
68
|
-
setFilters={setFilters}
|
|
69
|
-
/>
|
|
70
|
-
)}
|
|
71
|
-
|
|
72
|
-
{isLoading && (
|
|
73
|
-
<div className='seam-supported-device-table-content-state-block'>
|
|
74
|
-
<p>Loading device models...</p>
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
|
|
78
|
-
{isError && (
|
|
79
|
-
<div className='seam-supported-device-table-content-state-block'>
|
|
80
|
-
<p>There was an error fetching device models.</p>
|
|
81
|
-
<Button
|
|
82
|
-
variant='solid'
|
|
83
|
-
size='small'
|
|
84
|
-
onClick={() => {
|
|
85
|
-
void refetch()
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
Retry
|
|
89
|
-
</Button>
|
|
90
|
-
</div>
|
|
91
|
-
)}
|
|
92
|
-
|
|
93
|
-
{!isLoading && !isError && deviceModels !== null && (
|
|
94
|
-
<table className='seam-supported-device-table-content'>
|
|
95
|
-
<SupportedDeviceHeader />
|
|
96
|
-
<tbody>
|
|
97
|
-
{deviceModels.length !== 0 &&
|
|
98
|
-
deviceModels.map((deviceModel, index) => (
|
|
99
|
-
<SupportedDeviceRow
|
|
100
|
-
key={`${index}:${deviceModel.manufacturer_model_id}`}
|
|
101
|
-
deviceModel={deviceModel}
|
|
102
|
-
/>
|
|
103
|
-
))}
|
|
104
|
-
|
|
105
|
-
{deviceModels.length === 0 && (
|
|
106
|
-
<tr className='seam-supported-device-table-content-message-row'>
|
|
107
|
-
<td colSpan={6}>
|
|
108
|
-
<div className='seam-supported-device-table-content-message'>
|
|
109
|
-
{filterValue.length === 0 ? (
|
|
110
|
-
<p>No device models found.</p>
|
|
111
|
-
) : (
|
|
112
|
-
<>
|
|
113
|
-
<p>No device models matched your search.</p>
|
|
114
|
-
<Button
|
|
115
|
-
variant='outline'
|
|
116
|
-
size='small'
|
|
117
|
-
onClick={() => {
|
|
118
|
-
setFilterValue('')
|
|
119
|
-
}}
|
|
120
|
-
className='seam-supported-device-table-content-message-clear-search'
|
|
121
|
-
>
|
|
122
|
-
Clear search terms
|
|
123
|
-
</Button>
|
|
124
|
-
</>
|
|
125
|
-
)}
|
|
126
|
-
</div>
|
|
127
|
-
</td>
|
|
128
|
-
</tr>
|
|
129
|
-
)}
|
|
130
|
-
</tbody>
|
|
131
|
-
</table>
|
|
132
|
-
)}
|
|
133
|
-
</div>
|
|
134
|
-
)
|
|
135
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames'
|
|
2
|
-
|
|
3
|
-
import type { DeviceModel } from 'lib/ui/SupportedDeviceTable/types.js'
|
|
4
|
-
|
|
5
|
-
export interface SupportedDeviceRowProps {
|
|
6
|
-
deviceModel: DeviceModel
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function SupportedDeviceRow({ deviceModel }: SupportedDeviceRowProps) {
|
|
10
|
-
const statusColor = supportLevelColors[deviceModel.support_level] ?? 'gray'
|
|
11
|
-
return (
|
|
12
|
-
<tr>
|
|
13
|
-
<td>
|
|
14
|
-
<img width={40} src={deviceModel.icon_url} />
|
|
15
|
-
</td>
|
|
16
|
-
<td>{deviceModel.main_category}</td>
|
|
17
|
-
<td>{deviceModel.model_name}</td>
|
|
18
|
-
<td>{deviceModel.manufacturer_model_id}</td>
|
|
19
|
-
<td>{deviceModel.connection_type}</td>
|
|
20
|
-
<td>
|
|
21
|
-
<div
|
|
22
|
-
className={classNames('seam-status-pill', `status-${statusColor}`)}
|
|
23
|
-
>
|
|
24
|
-
<span>{deviceModel.support_level}</span>
|
|
25
|
-
</div>
|
|
26
|
-
</td>
|
|
27
|
-
</tr>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const supportLevelColors = {
|
|
32
|
-
Live: 'green',
|
|
33
|
-
Beta: 'blue',
|
|
34
|
-
Unsupported: 'orange',
|
|
35
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
2
|
-
|
|
3
|
-
import type { SupportedDeviceContentProps } from 'lib/ui/SupportedDeviceTable/SupportedDeviceContent.js'
|
|
4
|
-
import { SupportedDeviceContent } from 'lib/ui/SupportedDeviceTable/SupportedDeviceContent.js'
|
|
5
|
-
|
|
6
|
-
const client = new QueryClient()
|
|
7
|
-
|
|
8
|
-
export type SupportedDeviceTableProps = SupportedDeviceContentProps
|
|
9
|
-
|
|
10
|
-
export function SupportedDeviceTable(props: SupportedDeviceContentProps) {
|
|
11
|
-
return (
|
|
12
|
-
<QueryClientProvider client={client}>
|
|
13
|
-
<SupportedDeviceContent {...props} />
|
|
14
|
-
</QueryClientProvider>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface DeviceModel {
|
|
2
|
-
main_category: string
|
|
3
|
-
model_name: string
|
|
4
|
-
manufacturer_model_id: string
|
|
5
|
-
connection_type: string
|
|
6
|
-
support_level: 'Live' | 'Beta' | 'Unsupported'
|
|
7
|
-
brand: string
|
|
8
|
-
icon_url: string
|
|
9
|
-
seam_device_model_page_url: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Filters {
|
|
13
|
-
supportedOnly: boolean
|
|
14
|
-
category: string | null
|
|
15
|
-
brand: string | null
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|