@seamapi/react 0.27.0 → 1.1.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/index.css +97 -0
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/capitalize.d.ts +1 -0
- package/lib/capitalize.js +4 -0
- package/lib/capitalize.js.map +1 -0
- package/lib/icons/ChevronDown.d.ts +2 -0
- package/lib/icons/ChevronDown.js +3 -0
- package/lib/icons/ChevronDown.js.map +1 -0
- package/lib/ui/Button.d.ts +4 -3
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +21 -0
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js +20 -0
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +4 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +53 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +11 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js +50 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +1 -0
- package/lib/ui/{SupportedDevices/SupportedDevicesHeader.js → SupportedDeviceTable/SupportedDeviceHeader.js} +2 -2
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
- package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.d.ts +1 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +3 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +8 -0
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
- package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.d.ts +5 -0
- package/lib/ui/SupportedDeviceTable/types.js.map +1 -0
- package/lib/ui/index.d.ts +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/capitalize.ts +3 -0
- package/src/lib/icons/ChevronDown.tsx +19 -0
- package/src/lib/ui/Button.tsx +12 -6
- package/src/lib/ui/SupportedDeviceTable/FilterCategoryMenu.tsx +65 -0
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +147 -0
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +131 -0
- package/src/lib/ui/{SupportedDevices/SupportedDevicesHeader.tsx → SupportedDeviceTable/SupportedDeviceHeader.tsx} +1 -1
- package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.tsx +1 -1
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +16 -0
- package/src/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.ts +6 -0
- package/src/lib/ui/index.ts +1 -1
- package/src/styles/_supported-devices.scss +114 -0
- package/lib/ui/SupportedDevices/SupportedDeviceRow.js.map +0 -1
- package/lib/ui/SupportedDevices/SupportedDevices.d.ts +0 -1
- package/lib/ui/SupportedDevices/SupportedDevices.js +0 -21
- package/lib/ui/SupportedDevices/SupportedDevices.js.map +0 -1
- package/lib/ui/SupportedDevices/SupportedDevicesHeader.d.ts +0 -1
- package/lib/ui/SupportedDevices/SupportedDevicesHeader.js.map +0 -1
- package/lib/ui/SupportedDevices/types.js.map +0 -1
- package/src/lib/ui/SupportedDevices/SupportedDevices.tsx +0 -65
- /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/SupportedDeviceRow.js +0 -0
- /package/lib/ui/{SupportedDevices → SupportedDeviceTable}/types.js +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
import axios from 'axios'
|
|
3
|
-
|
|
4
|
-
import { Button } from 'lib/ui/Button.js'
|
|
5
|
-
import type { DeviceModel } from 'lib/ui/SupportedDevices/types.js'
|
|
6
|
-
|
|
7
|
-
import { SupportedDeviceRow } from './SupportedDeviceRow.js'
|
|
8
|
-
import { SupportedDevicesHeader } from './SupportedDevicesHeader.js'
|
|
9
|
-
|
|
10
|
-
export function SupportedDevices() {
|
|
11
|
-
const { data, isLoading, isError, refetch } = useQuery<{
|
|
12
|
-
data: {
|
|
13
|
-
device_models?: DeviceModel[]
|
|
14
|
-
}
|
|
15
|
-
}>({
|
|
16
|
-
queryKey: ['supported_devices'],
|
|
17
|
-
queryFn: async () => {
|
|
18
|
-
return await axios.get('https://devicedb.seam.co/api/device_models/list')
|
|
19
|
-
},
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<>
|
|
24
|
-
<div className='seam-supported-devices-table-wrap'>
|
|
25
|
-
{isLoading && (
|
|
26
|
-
<div className='seam-supported-devices-table-state-block'>
|
|
27
|
-
<p>Loading device models...</p>
|
|
28
|
-
</div>
|
|
29
|
-
)}
|
|
30
|
-
|
|
31
|
-
{isError && (
|
|
32
|
-
<div className='seam-supported-devices-table-state-block'>
|
|
33
|
-
<p>There was an error fetching device models.</p>
|
|
34
|
-
<Button
|
|
35
|
-
variant='solid'
|
|
36
|
-
size='small'
|
|
37
|
-
onClick={() => {
|
|
38
|
-
void refetch()
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
Retry
|
|
42
|
-
</Button>
|
|
43
|
-
</div>
|
|
44
|
-
)}
|
|
45
|
-
|
|
46
|
-
{!isLoading &&
|
|
47
|
-
!isError &&
|
|
48
|
-
data?.data?.device_models !== null &&
|
|
49
|
-
Array.isArray(data?.data?.device_models) && (
|
|
50
|
-
<table className='seam-supported-devices-table'>
|
|
51
|
-
<SupportedDevicesHeader />
|
|
52
|
-
<tbody>
|
|
53
|
-
{data.data.device_models.map((deviceModel) => (
|
|
54
|
-
<SupportedDeviceRow
|
|
55
|
-
key={deviceModel.manufacturer_model_id}
|
|
56
|
-
deviceModel={deviceModel}
|
|
57
|
-
/>
|
|
58
|
-
))}
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
)}
|
|
62
|
-
</div>
|
|
63
|
-
</>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
File without changes
|
|
File without changes
|