From 12d63e95477aef3847ff9621fed0314cad41fc5e Mon Sep 17 00:00:00 2001 From: David Crespo Date: Wed, 4 Sep 2024 16:58:52 -0500 Subject: [PATCH] kill the hooks barrel file --- app/components/AttachEphemeralIpModal.tsx | 2 +- app/components/RoundedSector.tsx | 2 +- app/components/Sidebar.tsx | 2 +- app/components/TopBarPicker.tsx | 2 +- app/components/form/fields/SubnetListbox.tsx | 2 +- app/components/form/fields/useItemsList.ts | 2 +- app/forms/disk-attach.tsx | 2 +- app/forms/disk-create.tsx | 2 +- app/forms/firewall-rules-common.tsx | 2 +- app/forms/firewall-rules-create.tsx | 2 +- app/forms/firewall-rules-edit.tsx | 6 +++++- app/forms/floating-ip-create.tsx | 2 +- app/forms/floating-ip-edit.tsx | 2 +- app/forms/idp/create.tsx | 2 +- app/forms/idp/edit.tsx | 2 +- app/forms/image-edit.tsx | 2 +- app/forms/image-from-snapshot.tsx | 2 +- app/forms/image-upload.tsx | 2 +- app/forms/instance-create.tsx | 2 +- app/forms/ip-pool-edit.tsx | 2 +- app/forms/ip-pool-range-add.tsx | 2 +- app/forms/network-interface-create.tsx | 2 +- app/forms/network-interface-edit.tsx | 2 +- app/forms/project-access.tsx | 2 +- app/forms/project-edit.tsx | 3 +-- app/forms/snapshot-create.tsx | 2 +- app/forms/subnet-create.tsx | 2 +- app/forms/subnet-edit.tsx | 2 +- app/forms/vpc-create.tsx | 2 +- app/forms/vpc-edit.tsx | 2 +- app/forms/vpc-router-create.tsx | 2 +- app/forms/vpc-router-edit.tsx | 2 +- app/forms/vpc-router-route-create.tsx | 2 +- app/forms/vpc-router-route-edit.tsx | 2 +- app/hooks/index.ts | 13 ------------- app/layouts/AuthenticatedLayout.tsx | 2 +- app/layouts/ProjectLayout.tsx | 3 ++- app/layouts/SettingsLayout.tsx | 2 +- app/layouts/SiloLayout.tsx | 2 +- app/layouts/SystemLayout.tsx | 2 +- app/main.tsx | 2 +- app/pages/LoginPage.tsx | 3 +-- app/pages/LoginPageSaml.tsx | 3 +-- app/pages/ProjectsPage.tsx | 3 +-- app/pages/project/access/ProjectAccessPage.tsx | 2 +- app/pages/project/disks/DisksPage.tsx | 2 +- app/pages/project/floating-ips/FloatingIpsPage.tsx | 2 +- app/pages/project/images/ImagesPage.tsx | 2 +- app/pages/project/instances/InstancesPage.tsx | 3 ++- .../project/instances/instance/InstancePage.tsx | 2 +- .../project/instances/instance/tabs/ConnectTab.tsx | 2 +- .../project/instances/instance/tabs/MetricsTab.tsx | 2 +- .../instances/instance/tabs/NetworkingTab.tsx | 6 +++++- .../project/instances/instance/tabs/StorageTab.tsx | 2 +- app/pages/project/snapshots/SnapshotsPage.tsx | 2 +- app/pages/project/vpcs/RouterPage.tsx | 2 +- app/pages/project/vpcs/VpcPage/VpcPage.tsx | 2 +- .../vpcs/VpcPage/tabs/VpcFirewallRulesTab.tsx | 2 +- .../project/vpcs/VpcPage/tabs/VpcRoutersTab.tsx | 2 +- .../project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx | 2 +- app/pages/project/vpcs/VpcsPage.tsx | 3 ++- .../system/inventory/sled/SledInstancesTab.tsx | 2 +- app/pages/system/inventory/sled/SledPage.tsx | 2 +- app/pages/system/networking/IpPoolPage.tsx | 2 +- app/pages/system/networking/IpPoolsPage.tsx | 2 +- app/pages/system/silos/SiloIdpsTab.tsx | 2 +- app/pages/system/silos/SiloIpPoolsTab.tsx | 2 +- app/pages/system/silos/SiloPage.tsx | 2 +- app/table/cells/InstanceLinkCell.tsx | 2 +- app/table/cells/RouterLinkCell.tsx | 2 +- app/ui/lib/SideModal.tsx | 2 +- app/ui/lib/Table.tsx | 2 +- 72 files changed, 82 insertions(+), 88 deletions(-) delete mode 100644 app/hooks/index.ts diff --git a/app/components/AttachEphemeralIpModal.tsx b/app/components/AttachEphemeralIpModal.tsx index 73b71f6c2c..3934bfea80 100644 --- a/app/components/AttachEphemeralIpModal.tsx +++ b/app/components/AttachEphemeralIpModal.tsx @@ -11,7 +11,7 @@ import { useForm } from 'react-hook-form' import { useApiMutation, useApiQueryClient, usePrefetchedApiQuery } from '~/api' import { ListboxField } from '~/components/form/fields/ListboxField' -import { useInstanceSelector } from '~/hooks' +import { useInstanceSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Badge } from '~/ui/lib/Badge' import { Modal } from '~/ui/lib/Modal' diff --git a/app/components/RoundedSector.tsx b/app/components/RoundedSector.tsx index d51325cee6..abf27bcd18 100644 --- a/app/components/RoundedSector.tsx +++ b/app/components/RoundedSector.tsx @@ -7,7 +7,7 @@ */ import { useEffect, useMemo, useState } from 'react' -import { useReducedMotion } from '~/hooks' +import { useReducedMotion } from '~/hooks/use-reduce-motion' export function RoundedSector({ angle, diff --git a/app/components/Sidebar.tsx b/app/components/Sidebar.tsx index 5484ecfa97..0cc380ca40 100644 --- a/app/components/Sidebar.tsx +++ b/app/components/Sidebar.tsx @@ -10,7 +10,7 @@ import { NavLink, useLocation } from 'react-router-dom' import { Action16Icon, Document16Icon } from '@oxide/design-system/icons/react' -import { openQuickActions } from '~/hooks' +import { openQuickActions } from '~/hooks/use-quick-actions' import { Button } from '~/ui/lib/Button' import { Truncate } from '~/ui/lib/Truncate' diff --git a/app/components/TopBarPicker.tsx b/app/components/TopBarPicker.tsx index d08041a6f3..884335fc82 100644 --- a/app/components/TopBarPicker.tsx +++ b/app/components/TopBarPicker.tsx @@ -21,7 +21,7 @@ import { useSiloSelector, useVpcRouterSelector, useVpcSelector, -} from '~/hooks' +} from '~/hooks/use-params' import { useCurrentUser } from '~/layouts/AuthenticatedLayout' import { PAGE_SIZE } from '~/table/QueryTable' import { Button } from '~/ui/lib/Button' diff --git a/app/components/form/fields/SubnetListbox.tsx b/app/components/form/fields/SubnetListbox.tsx index 77931f63b5..c7da27b64a 100644 --- a/app/components/form/fields/SubnetListbox.tsx +++ b/app/components/form/fields/SubnetListbox.tsx @@ -9,7 +9,7 @@ import { useWatch, type FieldPath, type FieldValues } from 'react-hook-form' import { useApiQuery } from '@oxide/api' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { ListboxField, type ListboxFieldProps } from './ListboxField' diff --git a/app/components/form/fields/useItemsList.ts b/app/components/form/fields/useItemsList.ts index f364899c84..b24137f686 100644 --- a/app/components/form/fields/useItemsList.ts +++ b/app/components/form/fields/useItemsList.ts @@ -9,7 +9,7 @@ import { useMemo } from 'react' import { useApiQuery } from '~/api' -import { useVpcSelector } from '~/hooks' +import { useVpcSelector } from '~/hooks/use-params' /** * Special value indicating no router. Must use helper functions to convert diff --git a/app/forms/disk-attach.tsx b/app/forms/disk-attach.tsx index ce9608aeb0..b21e3cf86a 100644 --- a/app/forms/disk-attach.tsx +++ b/app/forms/disk-attach.tsx @@ -11,7 +11,7 @@ import { useApiQuery, type ApiError } from '@oxide/api' import { ComboboxField } from '~/components/form/fields/ComboboxField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' const defaultValues = { name: '' } diff --git a/app/forms/disk-create.tsx b/app/forms/disk-create.tsx index 0951d0322d..8f50a6d230 100644 --- a/app/forms/disk-create.tsx +++ b/app/forms/disk-create.tsx @@ -28,7 +28,7 @@ import { ListboxField } from '~/components/form/fields/ListboxField' import { NameField } from '~/components/form/fields/NameField' import { RadioField } from '~/components/form/fields/RadioField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { FormDivider } from '~/ui/lib/Divider' import { FieldLabel } from '~/ui/lib/FieldLabel' diff --git a/app/forms/firewall-rules-common.tsx b/app/forms/firewall-rules-common.tsx index 0dc745d1f9..3b58f4c1ab 100644 --- a/app/forms/firewall-rules-common.tsx +++ b/app/forms/firewall-rules-common.tsx @@ -31,7 +31,7 @@ import { NameField } from '~/components/form/fields/NameField' import { NumberField } from '~/components/form/fields/NumberField' import { RadioField } from '~/components/form/fields/RadioField' import { TextField, TextFieldInner } from '~/components/form/fields/TextField' -import { useVpcSelector } from '~/hooks' +import { useVpcSelector } from '~/hooks/use-params' import { Badge } from '~/ui/lib/Badge' import { Button } from '~/ui/lib/Button' import { FormDivider } from '~/ui/lib/Divider' diff --git a/app/forms/firewall-rules-create.tsx b/app/forms/firewall-rules-create.tsx index e8f6fd5dce..dcde1aa133 100644 --- a/app/forms/firewall-rules-create.tsx +++ b/app/forms/firewall-rules-create.tsx @@ -20,7 +20,7 @@ import { } from '@oxide/api' import { SideModalForm } from '~/components/form/SideModalForm' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/firewall-rules-edit.tsx b/app/forms/firewall-rules-edit.tsx index a05eedcfd4..21db0ac3d0 100644 --- a/app/forms/firewall-rules-edit.tsx +++ b/app/forms/firewall-rules-edit.tsx @@ -18,7 +18,11 @@ import { import { trigger404 } from '~/components/ErrorBoundary' import { SideModalForm } from '~/components/form/SideModalForm' -import { getFirewallRuleSelector, useFirewallRuleSelector, useVpcSelector } from '~/hooks' +import { + getFirewallRuleSelector, + useFirewallRuleSelector, + useVpcSelector, +} from '~/hooks/use-params' import { invariant } from '~/util/invariant' import { pb } from '~/util/path-builder' diff --git a/app/forms/floating-ip-create.tsx b/app/forms/floating-ip-create.tsx index 1cc3713d5b..1393709ea9 100644 --- a/app/forms/floating-ip-create.tsx +++ b/app/forms/floating-ip-create.tsx @@ -23,7 +23,7 @@ import { DescriptionField } from '~/components/form/fields/DescriptionField' import { ListboxField } from '~/components/form/fields/ListboxField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Badge } from '~/ui/lib/Badge' import { Message } from '~/ui/lib/Message' diff --git a/app/forms/floating-ip-edit.tsx b/app/forms/floating-ip-edit.tsx index 9c96756fe8..44b19bd538 100644 --- a/app/forms/floating-ip-edit.tsx +++ b/app/forms/floating-ip-edit.tsx @@ -18,8 +18,8 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' +import { getFloatingIpSelector, useFloatingIpSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' -import { getFloatingIpSelector, useFloatingIpSelector } from 'app/hooks' import { pb } from 'app/util/path-builder' EditFloatingIpSideModalForm.loader = async ({ params }: LoaderFunctionArgs) => { diff --git a/app/forms/idp/create.tsx b/app/forms/idp/create.tsx index 1ddfea8225..4fa8e10fa7 100644 --- a/app/forms/idp/create.tsx +++ b/app/forms/idp/create.tsx @@ -15,7 +15,7 @@ import { FileField } from '~/components/form/fields/FileField' import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useSiloSelector } from '~/hooks' +import { useSiloSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { readBlobAsBase64 } from '~/util/file' import { pb } from '~/util/path-builder' diff --git a/app/forms/idp/edit.tsx b/app/forms/idp/edit.tsx index 84938958c9..a5cbc1e07a 100644 --- a/app/forms/idp/edit.tsx +++ b/app/forms/idp/edit.tsx @@ -15,7 +15,7 @@ import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { getIdpSelector, useIdpSelector } from '~/hooks' +import { getIdpSelector, useIdpSelector } from '~/hooks/use-params' import { DateTime } from '~/ui/lib/DateTime' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel } from '~/ui/lib/SideModal' diff --git a/app/forms/image-edit.tsx b/app/forms/image-edit.tsx index af65b13b9b..9b3ccf0d36 100644 --- a/app/forms/image-edit.tsx +++ b/app/forms/image-edit.tsx @@ -20,7 +20,7 @@ import { getSiloImageSelector, useProjectImageSelector, useSiloImageSelector, -} from '~/hooks' +} from '~/hooks/use-params' import { DateTime } from '~/ui/lib/DateTime' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel } from '~/ui/lib/SideModal' diff --git a/app/forms/image-from-snapshot.tsx b/app/forms/image-from-snapshot.tsx index fadf1525ca..48c6b9e793 100644 --- a/app/forms/image-from-snapshot.tsx +++ b/app/forms/image-from-snapshot.tsx @@ -21,7 +21,7 @@ import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { getProjectSnapshotSelector, useProjectSnapshotSelector } from '~/hooks' +import { getProjectSnapshotSelector, useProjectSnapshotSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { pb } from '~/util/path-builder' diff --git a/app/forms/image-upload.tsx b/app/forms/image-upload.tsx index 4cf292738f..d4068302e3 100644 --- a/app/forms/image-upload.tsx +++ b/app/forms/image-upload.tsx @@ -35,7 +35,7 @@ import { NameField } from '~/components/form/fields/NameField' import { RadioField } from '~/components/form/fields/RadioField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { Message } from '~/ui/lib/Message' import { Modal } from '~/ui/lib/Modal' import { Progress } from '~/ui/lib/Progress' diff --git a/app/forms/instance-create.tsx b/app/forms/instance-create.tsx index a6832ed7b6..9cf4126e2d 100644 --- a/app/forms/instance-create.tsx +++ b/app/forms/instance-create.tsx @@ -55,7 +55,7 @@ import { TextField } from '~/components/form/fields/TextField' import { Form } from '~/components/form/Form' import { FullPageForm } from '~/components/form/FullPageForm' import { HL } from '~/components/HL' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Badge } from '~/ui/lib/Badge' import { Button } from '~/ui/lib/Button' diff --git a/app/forms/ip-pool-edit.tsx b/app/forms/ip-pool-edit.tsx index b16ccf827d..73e2c942c5 100644 --- a/app/forms/ip-pool-edit.tsx +++ b/app/forms/ip-pool-edit.tsx @@ -18,7 +18,7 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { getIpPoolSelector, useIpPoolSelector } from '~/hooks' +import { getIpPoolSelector, useIpPoolSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/ip-pool-range-add.tsx b/app/forms/ip-pool-range-add.tsx index 753a8d466c..96fa8a1036 100644 --- a/app/forms/ip-pool-range-add.tsx +++ b/app/forms/ip-pool-range-add.tsx @@ -12,7 +12,7 @@ import { useApiMutation, useApiQueryClient, type IpRange } from '@oxide/api' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useIpPoolSelector } from '~/hooks' +import { useIpPoolSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Message } from '~/ui/lib/Message' import { pb } from '~/util/path-builder' diff --git a/app/forms/network-interface-create.tsx b/app/forms/network-interface-create.tsx index 99b9c51df4..43a93b9414 100644 --- a/app/forms/network-interface-create.tsx +++ b/app/forms/network-interface-create.tsx @@ -16,7 +16,7 @@ import { NameField } from '~/components/form/fields/NameField' import { SubnetListbox } from '~/components/form/fields/SubnetListbox' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { FormDivider } from '~/ui/lib/Divider' const defaultValues: InstanceNetworkInterfaceCreate = { diff --git a/app/forms/network-interface-edit.tsx b/app/forms/network-interface-edit.tsx index d417e082da..407e927a67 100644 --- a/app/forms/network-interface-edit.tsx +++ b/app/forms/network-interface-edit.tsx @@ -18,7 +18,7 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useInstanceSelector } from '~/hooks' +import { useInstanceSelector } from '~/hooks/use-params' type EditNetworkInterfaceFormProps = { editing: InstanceNetworkInterface diff --git a/app/forms/project-access.tsx b/app/forms/project-access.tsx index 3b66f4a89c..826b587744 100644 --- a/app/forms/project-access.tsx +++ b/app/forms/project-access.tsx @@ -16,7 +16,7 @@ import { import { ListboxField } from '~/components/form/fields/ListboxField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { actorToItem, diff --git a/app/forms/project-edit.tsx b/app/forms/project-edit.tsx index 727bc66f87..284c1de8de 100644 --- a/app/forms/project-edit.tsx +++ b/app/forms/project-edit.tsx @@ -18,11 +18,10 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' -import { getProjectSelector, useProjectSelector } from '../hooks' - EditProjectSideModalForm.loader = async ({ params }: LoaderFunctionArgs) => { const { project } = getProjectSelector(params) await apiQueryClient.prefetchQuery('projectView', { path: { project } }) diff --git a/app/forms/snapshot-create.tsx b/app/forms/snapshot-create.tsx index 6b89ff8219..d70ac35f15 100644 --- a/app/forms/snapshot-create.tsx +++ b/app/forms/snapshot-create.tsx @@ -21,7 +21,7 @@ import { ComboboxField } from '~/components/form/fields/ComboboxField' import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/subnet-create.tsx b/app/forms/subnet-create.tsx index 5c7fc17e53..5ed229999c 100644 --- a/app/forms/subnet-create.tsx +++ b/app/forms/subnet-create.tsx @@ -20,7 +20,7 @@ import { useCustomRouterItems, } from '~/components/form/fields/useItemsList' import { SideModalForm } from '~/components/form/SideModalForm' -import { useVpcSelector } from '~/hooks' +import { useVpcSelector } from '~/hooks/use-params' import { FormDivider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/forms/subnet-edit.tsx b/app/forms/subnet-edit.tsx index 59b38e4819..6bfd7e18c1 100644 --- a/app/forms/subnet-edit.tsx +++ b/app/forms/subnet-edit.tsx @@ -25,7 +25,7 @@ import { useCustomRouterItems, } from '~/components/form/fields/useItemsList' import { SideModalForm } from '~/components/form/SideModalForm' -import { getVpcSubnetSelector, useVpcSubnetSelector } from '~/hooks' +import { getVpcSubnetSelector, useVpcSubnetSelector } from '~/hooks/use-params' import { FormDivider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-create.tsx b/app/forms/vpc-create.tsx index 4c60d95495..f93d040b8c 100644 --- a/app/forms/vpc-create.tsx +++ b/app/forms/vpc-create.tsx @@ -14,7 +14,7 @@ import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-edit.tsx b/app/forms/vpc-edit.tsx index 411050df6e..c41022034c 100644 --- a/app/forms/vpc-edit.tsx +++ b/app/forms/vpc-edit.tsx @@ -18,7 +18,7 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-router-create.tsx b/app/forms/vpc-router-create.tsx index 7d99fe54cf..c808d3a099 100644 --- a/app/forms/vpc-router-create.tsx +++ b/app/forms/vpc-router-create.tsx @@ -13,7 +13,7 @@ import { useApiMutation, useApiQueryClient, type VpcRouterCreate } from '@oxide/ import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { useVpcSelector } from '~/hooks' +import { useVpcSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-router-edit.tsx b/app/forms/vpc-router-edit.tsx index e070490c30..3d8067022d 100644 --- a/app/forms/vpc-router-edit.tsx +++ b/app/forms/vpc-router-edit.tsx @@ -23,7 +23,7 @@ import { import { DescriptionField } from '~/components/form/fields/DescriptionField' import { NameField } from '~/components/form/fields/NameField' import { SideModalForm } from '~/components/form/SideModalForm' -import { getVpcRouterSelector, useVpcRouterSelector } from '~/hooks' +import { getVpcRouterSelector, useVpcRouterSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-router-route-create.tsx b/app/forms/vpc-router-route-create.tsx index b2a5ff1119..597c82ceda 100644 --- a/app/forms/vpc-router-route-create.tsx +++ b/app/forms/vpc-router-route-create.tsx @@ -16,7 +16,7 @@ import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' import { fields, targetValueDescription } from '~/forms/vpc-router-route/shared' -import { useVpcRouterSelector } from '~/hooks' +import { useVpcRouterSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { pb } from '~/util/path-builder' diff --git a/app/forms/vpc-router-route-edit.tsx b/app/forms/vpc-router-route-edit.tsx index fe4fc636d3..bfe52466bb 100644 --- a/app/forms/vpc-router-route-edit.tsx +++ b/app/forms/vpc-router-route-edit.tsx @@ -27,7 +27,7 @@ import { routeFormMessage, targetValueDescription, } from '~/forms/vpc-router-route/shared' -import { getVpcRouterRouteSelector, useVpcRouterRouteSelector } from '~/hooks' +import { getVpcRouterRouteSelector, useVpcRouterRouteSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Message } from '~/ui/lib/Message' import { pb } from '~/util/path-builder' diff --git a/app/hooks/index.ts b/app/hooks/index.ts deleted file mode 100644 index 22497b9f6e..0000000000 --- a/app/hooks/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ - -export * from './use-is-overflow' -export * from './use-key' -export * from './use-params' -export * from './use-quick-actions' -export * from './use-reduce-motion' diff --git a/app/layouts/AuthenticatedLayout.tsx b/app/layouts/AuthenticatedLayout.tsx index 170807110b..b4cbc16682 100644 --- a/app/layouts/AuthenticatedLayout.tsx +++ b/app/layouts/AuthenticatedLayout.tsx @@ -9,7 +9,7 @@ import { Outlet } from 'react-router-dom' import { apiQueryClient, useApiQueryErrorsAllowed, usePrefetchedApiQuery } from '@oxide/api' -import { QuickActions } from '~/hooks' +import { QuickActions } from '~/hooks/use-quick-actions' import { invariant } from '~/util/invariant' /** diff --git a/app/layouts/ProjectLayout.tsx b/app/layouts/ProjectLayout.tsx index ebb53d0079..5c186c213a 100644 --- a/app/layouts/ProjectLayout.tsx +++ b/app/layouts/ProjectLayout.tsx @@ -33,7 +33,8 @@ import { VpcPicker, VpcRouterPicker, } from '~/components/TopBarPicker' -import { getProjectSelector, useProjectSelector, useQuickActions } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' +import { useQuickActions } from '~/hooks/use-quick-actions' import { Divider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/layouts/SettingsLayout.tsx b/app/layouts/SettingsLayout.tsx index 4704399197..1fea93b502 100644 --- a/app/layouts/SettingsLayout.tsx +++ b/app/layouts/SettingsLayout.tsx @@ -12,7 +12,7 @@ import { Folder16Icon, Key16Icon, Profile16Icon } from '@oxide/design-system/ico import { TopBar } from '~/components/TopBar' import { SiloSystemPicker } from '~/components/TopBarPicker' -import { useQuickActions } from '~/hooks' +import { useQuickActions } from '~/hooks/use-quick-actions' import { Divider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/layouts/SiloLayout.tsx b/app/layouts/SiloLayout.tsx index 5872398a37..bb8e946c16 100644 --- a/app/layouts/SiloLayout.tsx +++ b/app/layouts/SiloLayout.tsx @@ -18,7 +18,7 @@ import { import { DocsLinkItem, NavLinkItem, Sidebar } from '~/components/Sidebar' import { TopBar } from '~/components/TopBar' import { ProjectPicker, SiloSystemPicker } from '~/components/TopBarPicker' -import { useQuickActions } from '~/hooks' +import { useQuickActions } from '~/hooks/use-quick-actions' import { Divider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/layouts/SystemLayout.tsx b/app/layouts/SystemLayout.tsx index 62248ed91d..a2463e31c0 100644 --- a/app/layouts/SystemLayout.tsx +++ b/app/layouts/SystemLayout.tsx @@ -20,7 +20,7 @@ import { trigger404 } from '~/components/ErrorBoundary' import { DocsLinkItem, NavLinkItem, Sidebar } from '~/components/Sidebar' import { TopBar } from '~/components/TopBar' import { IpPoolPicker, SiloPicker, SiloSystemPicker } from '~/components/TopBarPicker' -import { useQuickActions } from '~/hooks' +import { useQuickActions } from '~/hooks/use-quick-actions' import { Divider } from '~/ui/lib/Divider' import { pb } from '~/util/path-builder' diff --git a/app/main.tsx b/app/main.tsx index 3ba905ea32..2a822ca65f 100644 --- a/app/main.tsx +++ b/app/main.tsx @@ -15,7 +15,7 @@ import { queryClient } from '@oxide/api' import { ConfirmActionModal } from './components/ConfirmActionModal' import { ErrorBoundary } from './components/ErrorBoundary' -import { ReduceMotion } from './hooks' +import { ReduceMotion } from './hooks/use-reduce-motion' // stripped out by rollup in production import { startMockAPI } from './msw-mock-api' import { routes } from './routes' diff --git a/app/pages/LoginPage.tsx b/app/pages/LoginPage.tsx index 37cb2cb365..92b14cc7f2 100644 --- a/app/pages/LoginPage.tsx +++ b/app/pages/LoginPage.tsx @@ -12,13 +12,12 @@ import { useNavigate, useSearchParams } from 'react-router-dom' import { useApiMutation, type UsernamePasswordCredentials } from '@oxide/api' import { TextFieldInner } from '~/components/form/fields/TextField' +import { useSiloSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { Button } from '~/ui/lib/Button' import { Identicon } from '~/ui/lib/Identicon' import { pb } from '~/util/path-builder' -import { useSiloSelector } from '../hooks' - const defaultValues: UsernamePasswordCredentials = { username: '', password: '', diff --git a/app/pages/LoginPageSaml.tsx b/app/pages/LoginPageSaml.tsx index 578ac58457..143ffdab40 100644 --- a/app/pages/LoginPageSaml.tsx +++ b/app/pages/LoginPageSaml.tsx @@ -8,11 +8,10 @@ import cn from 'classnames' import { useSearchParams } from 'react-router-dom' +import { useIdpSelector } from '~/hooks/use-params' import { buttonStyle } from '~/ui/lib/Button' import { Identicon } from '~/ui/lib/Identicon' -import { useIdpSelector } from '../hooks' - /** SAML "login page" that just links to the actual IdP */ export function LoginPageSaml() { const [searchParams] = useSearchParams() diff --git a/app/pages/ProjectsPage.tsx b/app/pages/ProjectsPage.tsx index e8f71bead5..32b749a91e 100644 --- a/app/pages/ProjectsPage.tsx +++ b/app/pages/ProjectsPage.tsx @@ -19,6 +19,7 @@ import { import { Folder16Icon, Folder24Icon } from '@oxide/design-system/icons/react' import { DocsPopover } from '~/components/DocsPopover' +import { useQuickActions } from '~/hooks/use-quick-actions' import { confirmDelete } from '~/stores/confirm-delete' import { makeLinkCell } from '~/table/cells/LinkCell' import { useColsWithActions, type MenuAction } from '~/table/columns/action-col' @@ -31,8 +32,6 @@ import { TableActions } from '~/ui/lib/Table' import { docLinks } from '~/util/links' import { pb } from '~/util/path-builder' -import { useQuickActions } from '../hooks' - const EmptyState = () => ( } diff --git a/app/pages/project/access/ProjectAccessPage.tsx b/app/pages/project/access/ProjectAccessPage.tsx index 79f5939f84..832749910e 100644 --- a/app/pages/project/access/ProjectAccessPage.tsx +++ b/app/pages/project/access/ProjectAccessPage.tsx @@ -32,7 +32,7 @@ import { ProjectAccessAddUserSideModal, ProjectAccessEditUserSideModal, } from '~/forms/project-access' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { getActionsCol } from '~/table/columns/action-col' import { Table } from '~/table/Table' diff --git a/app/pages/project/disks/DisksPage.tsx b/app/pages/project/disks/DisksPage.tsx index 94ae333a8b..6d4120f03d 100644 --- a/app/pages/project/disks/DisksPage.tsx +++ b/app/pages/project/disks/DisksPage.tsx @@ -21,7 +21,7 @@ import { Storage16Icon, Storage24Icon } from '@oxide/design-system/icons/react' import { DocsPopover } from '~/components/DocsPopover' import { DiskStateBadge } from '~/components/StateBadge' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { InstanceLinkCell } from '~/table/cells/InstanceLinkCell' diff --git a/app/pages/project/floating-ips/FloatingIpsPage.tsx b/app/pages/project/floating-ips/FloatingIpsPage.tsx index ea12da0640..3166dd0c60 100644 --- a/app/pages/project/floating-ips/FloatingIpsPage.tsx +++ b/app/pages/project/floating-ips/FloatingIpsPage.tsx @@ -24,7 +24,7 @@ import { IpGlobal16Icon, IpGlobal24Icon } from '@oxide/design-system/icons/react import { DocsPopover } from '~/components/DocsPopover' import { ListboxField } from '~/components/form/fields/ListboxField' import { HL } from '~/components/HL' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { confirmAction } from '~/stores/confirm-action' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' diff --git a/app/pages/project/images/ImagesPage.tsx b/app/pages/project/images/ImagesPage.tsx index 700bb9eb4b..726357a6f8 100644 --- a/app/pages/project/images/ImagesPage.tsx +++ b/app/pages/project/images/ImagesPage.tsx @@ -13,7 +13,7 @@ import { apiQueryClient, useApiMutation, useApiQueryClient, type Image } from '@ import { Images16Icon, Images24Icon } from '@oxide/design-system/icons/react' import { DocsPopover } from '~/components/DocsPopover' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { makeLinkCell } from '~/table/cells/LinkCell' diff --git a/app/pages/project/instances/InstancesPage.tsx b/app/pages/project/instances/InstancesPage.tsx index 8c5cfc36fa..343f4c1871 100644 --- a/app/pages/project/instances/InstancesPage.tsx +++ b/app/pages/project/instances/InstancesPage.tsx @@ -16,7 +16,8 @@ import { Instances24Icon } from '@oxide/design-system/icons/react' import { instanceTransitioning } from '~/api/util' import { InstanceDocsPopover } from '~/components/InstanceDocsPopover' import { RefreshButton } from '~/components/RefreshButton' -import { getProjectSelector, useProjectSelector, useQuickActions } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' +import { useQuickActions } from '~/hooks/use-quick-actions' import { InstanceStateCell } from '~/table/cells/InstanceStateCell' import { makeLinkCell } from '~/table/cells/LinkCell' import { getActionsCol } from '~/table/columns/action-col' diff --git a/app/pages/project/instances/instance/InstancePage.tsx b/app/pages/project/instances/instance/InstancePage.tsx index 7241f86d91..8e1a69ca3e 100644 --- a/app/pages/project/instances/instance/InstancePage.tsx +++ b/app/pages/project/instances/instance/InstancePage.tsx @@ -24,7 +24,7 @@ import { MoreActionsMenu } from '~/components/MoreActionsMenu' import { RefreshButton } from '~/components/RefreshButton' import { RouteTabs, Tab } from '~/components/RouteTabs' import { InstanceStateBadge } from '~/components/StateBadge' -import { getInstanceSelector, useInstanceSelector } from '~/hooks' +import { getInstanceSelector, useInstanceSelector } from '~/hooks/use-params' import { EmptyCell } from '~/table/cells/EmptyCell' import { DateTime } from '~/ui/lib/DateTime' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' diff --git a/app/pages/project/instances/instance/tabs/ConnectTab.tsx b/app/pages/project/instances/instance/tabs/ConnectTab.tsx index 9673527211..71b07990dc 100644 --- a/app/pages/project/instances/instance/tabs/ConnectTab.tsx +++ b/app/pages/project/instances/instance/tabs/ConnectTab.tsx @@ -10,7 +10,7 @@ import { Link, type LoaderFunctionArgs } from 'react-router-dom' import { apiQueryClient, usePrefetchedApiQuery } from '~/api' import { EquivalentCliCommand } from '~/components/EquivalentCliCommand' -import { getInstanceSelector, useInstanceSelector } from '~/hooks' +import { getInstanceSelector, useInstanceSelector } from '~/hooks/use-params' import { buttonStyle } from '~/ui/lib/Button' import { InlineCode } from '~/ui/lib/InlineCode' import { LearnMore, SettingsGroup } from '~/ui/lib/SettingsGroup' diff --git a/app/pages/project/instances/instance/tabs/MetricsTab.tsx b/app/pages/project/instances/instance/tabs/MetricsTab.tsx index 72565d79ac..20fc68b853 100644 --- a/app/pages/project/instances/instance/tabs/MetricsTab.tsx +++ b/app/pages/project/instances/instance/tabs/MetricsTab.tsx @@ -18,7 +18,7 @@ import { import { Storage24Icon } from '@oxide/design-system/icons/react' import { useDateTimeRangePicker } from '~/components/form/fields/DateTimeRangePicker' -import { getInstanceSelector, useInstanceSelector } from '~/hooks' +import { getInstanceSelector, useInstanceSelector } from '~/hooks/use-params' import { EmptyMessage } from '~/ui/lib/EmptyMessage' import { Listbox } from '~/ui/lib/Listbox' import { Spinner } from '~/ui/lib/Spinner' diff --git a/app/pages/project/instances/instance/tabs/NetworkingTab.tsx b/app/pages/project/instances/instance/tabs/NetworkingTab.tsx index 83de8380b0..19b8568eaf 100644 --- a/app/pages/project/instances/instance/tabs/NetworkingTab.tsx +++ b/app/pages/project/instances/instance/tabs/NetworkingTab.tsx @@ -26,7 +26,11 @@ import { AttachFloatingIpModal } from '~/components/AttachFloatingIpModal' import { HL } from '~/components/HL' import { CreateNetworkInterfaceForm } from '~/forms/network-interface-create' import { EditNetworkInterfaceForm } from '~/forms/network-interface-edit' -import { getInstanceSelector, useInstanceSelector, useProjectSelector } from '~/hooks' +import { + getInstanceSelector, + useInstanceSelector, + useProjectSelector, +} from '~/hooks/use-params' import { confirmAction } from '~/stores/confirm-action' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' diff --git a/app/pages/project/instances/instance/tabs/StorageTab.tsx b/app/pages/project/instances/instance/tabs/StorageTab.tsx index 44df9a7c4f..d079c975a6 100644 --- a/app/pages/project/instances/instance/tabs/StorageTab.tsx +++ b/app/pages/project/instances/instance/tabs/StorageTab.tsx @@ -24,7 +24,7 @@ import { Storage24Icon } from '@oxide/design-system/icons/react' import { DiskStateBadge } from '~/components/StateBadge' import { AttachDiskSideModalForm } from '~/forms/disk-attach' import { CreateDiskSideModalForm } from '~/forms/disk-create' -import { getInstanceSelector, useInstanceSelector } from '~/hooks' +import { getInstanceSelector, useInstanceSelector } from '~/hooks/use-params' import { addToast } from '~/stores/toast' import { useColsWithActions, type MenuAction } from '~/table/columns/action-col' import { Columns } from '~/table/columns/common' diff --git a/app/pages/project/snapshots/SnapshotsPage.tsx b/app/pages/project/snapshots/SnapshotsPage.tsx index a5dac4a26a..d2b0e28ab1 100644 --- a/app/pages/project/snapshots/SnapshotsPage.tsx +++ b/app/pages/project/snapshots/SnapshotsPage.tsx @@ -20,7 +20,7 @@ import { Snapshots16Icon, Snapshots24Icon } from '@oxide/design-system/icons/rea import { DocsPopover } from '~/components/DocsPopover' import { SnapshotStateBadge } from '~/components/StateBadge' -import { getProjectSelector, useProjectSelector } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { SkeletonCell } from '~/table/cells/EmptyCell' import { useColsWithActions, type MenuAction } from '~/table/columns/action-col' diff --git a/app/pages/project/vpcs/RouterPage.tsx b/app/pages/project/vpcs/RouterPage.tsx index 09f870de6a..ca5c7cd8f7 100644 --- a/app/pages/project/vpcs/RouterPage.tsx +++ b/app/pages/project/vpcs/RouterPage.tsx @@ -24,7 +24,7 @@ import { DocsPopover } from '~/components/DocsPopover' import { HL } from '~/components/HL' import { MoreActionsMenu } from '~/components/MoreActionsMenu' import { routeFormMessage } from '~/forms/vpc-router-route/shared' -import { getVpcRouterSelector, useVpcRouterSelector } from '~/hooks' +import { getVpcRouterSelector, useVpcRouterSelector } from '~/hooks/use-params' import { confirmAction } from '~/stores/confirm-action' import { addToast } from '~/stores/toast' import { DescriptionCell } from '~/table/cells/DescriptionCell' diff --git a/app/pages/project/vpcs/VpcPage/VpcPage.tsx b/app/pages/project/vpcs/VpcPage/VpcPage.tsx index b1bf4073e5..ff7c1717ac 100644 --- a/app/pages/project/vpcs/VpcPage/VpcPage.tsx +++ b/app/pages/project/vpcs/VpcPage/VpcPage.tsx @@ -11,7 +11,7 @@ import { apiQueryClient, usePrefetchedApiQuery } from '@oxide/api' import { Networking24Icon } from '@oxide/design-system/icons/react' import { RouteTabs, Tab } from '~/components/RouteTabs' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { DescriptionCell } from '~/table/cells/DescriptionCell' import { DateTime } from '~/ui/lib/DateTime' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' diff --git a/app/pages/project/vpcs/VpcPage/tabs/VpcFirewallRulesTab.tsx b/app/pages/project/vpcs/VpcPage/tabs/VpcFirewallRulesTab.tsx index 3f2b21eb5b..892f096275 100644 --- a/app/pages/project/vpcs/VpcPage/tabs/VpcFirewallRulesTab.tsx +++ b/app/pages/project/vpcs/VpcPage/tabs/VpcFirewallRulesTab.tsx @@ -19,7 +19,7 @@ import { } from '@oxide/api' import { ListPlusCell } from '~/components/ListPlusCell' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { EnabledCell } from '~/table/cells/EnabledCell' import { LinkCell } from '~/table/cells/LinkCell' diff --git a/app/pages/project/vpcs/VpcPage/tabs/VpcRoutersTab.tsx b/app/pages/project/vpcs/VpcPage/tabs/VpcRoutersTab.tsx index 784e87e766..b030c764fd 100644 --- a/app/pages/project/vpcs/VpcPage/tabs/VpcRoutersTab.tsx +++ b/app/pages/project/vpcs/VpcPage/tabs/VpcRoutersTab.tsx @@ -12,7 +12,7 @@ import { Outlet, useNavigate, type LoaderFunctionArgs } from 'react-router-dom' import { apiQueryClient, useApiMutation, type VpcRouter } from '@oxide/api' import { routeFormMessage } from '~/forms/vpc-router-route/shared' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { makeLinkCell } from '~/table/cells/LinkCell' diff --git a/app/pages/project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx b/app/pages/project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx index 1fccb74bd3..285bb2b82c 100644 --- a/app/pages/project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx +++ b/app/pages/project/vpcs/VpcPage/tabs/VpcSubnetsTab.tsx @@ -16,7 +16,7 @@ import { type VpcSubnet, } from '@oxide/api' -import { getVpcSelector, useVpcSelector } from '~/hooks' +import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { makeLinkCell } from '~/table/cells/LinkCell' import { RouterLinkCell } from '~/table/cells/RouterLinkCell' diff --git a/app/pages/project/vpcs/VpcsPage.tsx b/app/pages/project/vpcs/VpcsPage.tsx index 2cc0ecf014..1bd7147655 100644 --- a/app/pages/project/vpcs/VpcsPage.tsx +++ b/app/pages/project/vpcs/VpcsPage.tsx @@ -20,7 +20,8 @@ import { import { Networking16Icon, Networking24Icon } from '@oxide/design-system/icons/react' import { DocsPopover } from '~/components/DocsPopover' -import { getProjectSelector, useProjectSelector, useQuickActions } from '~/hooks' +import { getProjectSelector, useProjectSelector } from '~/hooks/use-params' +import { useQuickActions } from '~/hooks/use-quick-actions' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { SkeletonCell } from '~/table/cells/EmptyCell' diff --git a/app/pages/system/inventory/sled/SledInstancesTab.tsx b/app/pages/system/inventory/sled/SledInstancesTab.tsx index 50ba82a23b..2cee238522 100644 --- a/app/pages/system/inventory/sled/SledInstancesTab.tsx +++ b/app/pages/system/inventory/sled/SledInstancesTab.tsx @@ -13,7 +13,7 @@ import { apiQueryClient, type SledInstance } from '@oxide/api' import { Instances24Icon } from '@oxide/design-system/icons/react' import { InstanceStateBadge } from '~/components/StateBadge' -import { requireSledParams, useSledParams } from '~/hooks' +import { requireSledParams, useSledParams } from '~/hooks/use-params' import { InstanceResourceCell } from '~/table/cells/InstanceResourceCell' import { useColsWithActions, type MenuAction } from '~/table/columns/action-col' import { Columns } from '~/table/columns/common' diff --git a/app/pages/system/inventory/sled/SledPage.tsx b/app/pages/system/inventory/sled/SledPage.tsx index 4c3da098b4..633b5f6b39 100644 --- a/app/pages/system/inventory/sled/SledPage.tsx +++ b/app/pages/system/inventory/sled/SledPage.tsx @@ -12,7 +12,7 @@ import { apiQueryClient, usePrefetchedApiQuery } from '@oxide/api' import { Servers24Icon } from '@oxide/design-system/icons/react' import { RouteTabs, Tab } from '~/components/RouteTabs' -import { requireSledParams, useSledParams } from '~/hooks' +import { requireSledParams, useSledParams } from '~/hooks/use-params' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { pb } from '~/util/path-builder' diff --git a/app/pages/system/networking/IpPoolPage.tsx b/app/pages/system/networking/IpPoolPage.tsx index 9d670b7b9f..b720079880 100644 --- a/app/pages/system/networking/IpPoolPage.tsx +++ b/app/pages/system/networking/IpPoolPage.tsx @@ -29,7 +29,7 @@ import { ComboboxField } from '~/components/form/fields/ComboboxField' import { HL } from '~/components/HL' import { MoreActionsMenu } from '~/components/MoreActionsMenu' import { QueryParamTabs } from '~/components/QueryParamTabs' -import { getIpPoolSelector, useIpPoolSelector } from '~/hooks' +import { getIpPoolSelector, useIpPoolSelector } from '~/hooks/use-params' import { confirmAction } from '~/stores/confirm-action' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' diff --git a/app/pages/system/networking/IpPoolsPage.tsx b/app/pages/system/networking/IpPoolsPage.tsx index b10c7288aa..8084dc77f7 100644 --- a/app/pages/system/networking/IpPoolsPage.tsx +++ b/app/pages/system/networking/IpPoolsPage.tsx @@ -21,7 +21,7 @@ import { IpGlobal16Icon, IpGlobal24Icon } from '@oxide/design-system/icons/react import { DocsPopover } from '~/components/DocsPopover' import { IpUtilCell } from '~/components/IpPoolUtilization' -import { useQuickActions } from '~/hooks' +import { useQuickActions } from '~/hooks/use-quick-actions' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { SkeletonCell } from '~/table/cells/EmptyCell' diff --git a/app/pages/system/silos/SiloIdpsTab.tsx b/app/pages/system/silos/SiloIdpsTab.tsx index 2c6d90847f..b8130edb3c 100644 --- a/app/pages/system/silos/SiloIdpsTab.tsx +++ b/app/pages/system/silos/SiloIdpsTab.tsx @@ -12,7 +12,7 @@ import { Outlet } from 'react-router-dom' import { Cloud24Icon } from '@oxide/design-system/icons/react' import type { IdentityProvider } from '~/api' -import { useSiloSelector } from '~/hooks' +import { useSiloSelector } from '~/hooks/use-params' import { LinkCell } from '~/table/cells/LinkCell' import { Columns } from '~/table/columns/common' import { useQueryTable } from '~/table/QueryTable' diff --git a/app/pages/system/silos/SiloIpPoolsTab.tsx b/app/pages/system/silos/SiloIpPoolsTab.tsx index 5d525fdc47..fc11cdd20f 100644 --- a/app/pages/system/silos/SiloIpPoolsTab.tsx +++ b/app/pages/system/silos/SiloIpPoolsTab.tsx @@ -15,7 +15,7 @@ import { Networking24Icon } from '@oxide/design-system/icons/react' import { ComboboxField } from '~/components/form/fields/ComboboxField' import { HL } from '~/components/HL' -import { useSiloSelector } from '~/hooks' +import { useSiloSelector } from '~/hooks/use-params' import { confirmAction } from '~/stores/confirm-action' import { addToast } from '~/stores/toast' import { DefaultPoolCell } from '~/table/cells/DefaultPoolCell' diff --git a/app/pages/system/silos/SiloPage.tsx b/app/pages/system/silos/SiloPage.tsx index 48f1ac22fb..db8bf4c64c 100644 --- a/app/pages/system/silos/SiloPage.tsx +++ b/app/pages/system/silos/SiloPage.tsx @@ -12,7 +12,7 @@ import { Cloud16Icon, Cloud24Icon, NextArrow12Icon } from '@oxide/design-system/ import { DocsPopover } from '~/components/DocsPopover' import { QueryParamTabs } from '~/components/QueryParamTabs' -import { getSiloSelector, useSiloSelector } from '~/hooks' +import { getSiloSelector, useSiloSelector } from '~/hooks/use-params' import { DescriptionCell } from '~/table/cells/DescriptionCell' import { PAGE_SIZE } from '~/table/QueryTable' import { Badge } from '~/ui/lib/Badge' diff --git a/app/table/cells/InstanceLinkCell.tsx b/app/table/cells/InstanceLinkCell.tsx index f0502b756b..b2fbe019ca 100644 --- a/app/table/cells/InstanceLinkCell.tsx +++ b/app/table/cells/InstanceLinkCell.tsx @@ -8,7 +8,7 @@ import { useApiQuery } from '@oxide/api' -import { useProjectSelector } from '~/hooks' +import { useProjectSelector } from '~/hooks/use-params' import { pb } from '~/util/path-builder' import { SkeletonCell } from './EmptyCell' diff --git a/app/table/cells/RouterLinkCell.tsx b/app/table/cells/RouterLinkCell.tsx index 81e19b10ef..9654466739 100644 --- a/app/table/cells/RouterLinkCell.tsx +++ b/app/table/cells/RouterLinkCell.tsx @@ -7,7 +7,7 @@ */ import { useApiQuery } from '~/api' -import { useVpcSelector } from '~/hooks' +import { useVpcSelector } from '~/hooks/use-params' import { Badge } from '~/ui/lib/Badge' import { pb } from '~/util/path-builder' diff --git a/app/ui/lib/SideModal.tsx b/app/ui/lib/SideModal.tsx index fd587f2c48..63b1d89262 100644 --- a/app/ui/lib/SideModal.tsx +++ b/app/ui/lib/SideModal.tsx @@ -12,7 +12,7 @@ import React, { useRef, type ReactNode } from 'react' import { Close12Icon, Error12Icon } from '@oxide/design-system/icons/react' -import { useIsOverflow } from '~/hooks' +import { useIsOverflow } from '~/hooks/use-is-overflow' import { Message } from '~/ui/lib/Message' import { classed } from '~/util/classed' diff --git a/app/ui/lib/Table.tsx b/app/ui/lib/Table.tsx index 53786f75df..6f5f9f5716 100644 --- a/app/ui/lib/Table.tsx +++ b/app/ui/lib/Table.tsx @@ -9,7 +9,7 @@ import cn from 'classnames' import React, { useRef, type ReactElement } from 'react' import SimpleBar from 'simplebar-react' -import { useIsOverflow } from '~/hooks' +import { useIsOverflow } from '~/hooks/use-is-overflow' import { classed } from '~/util/classed' export type TableProps = JSX.IntrinsicElements['table']