diff --git a/console/src/range/CreateLayout.tsx b/console/src/range/CreateLayout.tsx index 9660c8929..4bb5639f0 100644 --- a/console/src/range/CreateLayout.tsx +++ b/console/src/range/CreateLayout.tsx @@ -9,7 +9,7 @@ import "@/range/CreateLayout.css"; -import { ontology, ranger, TimeRange, TimeStamp } from "@synnaxlabs/client"; +import { ontology, type ranger, TimeRange, TimeStamp } from "@synnaxlabs/client"; import { Icon } from "@synnaxlabs/media"; import { Align, diff --git a/console/src/range/Select.tsx b/console/src/range/Select.tsx index 32ef3c046..82283be28 100644 --- a/console/src/range/Select.tsx +++ b/console/src/range/Select.tsx @@ -27,14 +27,13 @@ import { Layout } from "@/layout"; import { createLayout } from "@/range/CreateLayout"; import { type Range } from "@/range/slice"; -export interface SelectMultipleRangesProps - extends Select.MultipleProps {} +interface SelectMultipleRangesProps extends Select.MultipleProps {} const dynamicIcon = ( ); -export const listColumns: Array> = [ +const listColumns: Array> = [ { key: "name", name: "Name", @@ -72,9 +71,7 @@ const RenderTag = ({ const renderTag = componentRenderProp(RenderTag); -export const SelectMultipleRanges = ( - props: SelectMultipleRangesProps, -): ReactElement => ( +const SelectMultipleRanges = (props: SelectMultipleRangesProps): ReactElement => ( ); -export interface SelectSingleRangeProps extends Select.SingleProps {} +interface SelectSingleRangeProps extends Select.SingleProps {} -export const SelectRange = (props: SelectSingleRangeProps): ReactElement => ( +const SelectRange = (props: SelectSingleRangeProps): ReactElement => ( ); -export interface SelectMultipleInputItemProps +interface SelectMultipleInputItemProps extends Omit, Pick { value: string[]; @@ -97,13 +94,13 @@ export interface SelectMultipleInputItemProps } const SelectEmptyContent = (): ReactElement => { - const newLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); return ( No Ranges: - newLayout(createLayout({}))}> + placer(createLayout({}))}> Define a Range @@ -126,7 +123,7 @@ export const SelectMultipleInputItem = ({ ); -export interface SelectInputItemProps +interface SelectInputItemProps extends Omit, Input.Control, Pick {} diff --git a/console/src/range/Toolbar.tsx b/console/src/range/Toolbar.tsx index 2c55e0ddb..1c86313b6 100644 --- a/console/src/range/Toolbar.tsx +++ b/console/src/range/Toolbar.tsx @@ -166,12 +166,12 @@ const useViewDetails = (): ((key: string) => void) => { const store = useStore(); const client = Synnax.use(); const addStatus = Status.useAggregator(); - const placeLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); return useMutation({ mutationFn: async (key: string) => { if (client == null) return; const rng = await fetchIfNotInState(store, client, key); - placeLayout({ ...overviewLayout, name: rng.name, key: rng.key }); + placer({ ...overviewLayout, name: rng.name, key: rng.key }); }, onError: (e) => { addStatus({ @@ -186,13 +186,13 @@ const useViewDetails = (): ((key: string) => void) => { const useAddToNewPlot = (): ((key: string) => void) => { const store = useStore(); const client = Synnax.use(); - const placeLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); const addStatus = Status.useAggregator(); return useMutation({ mutationFn: async (key: string) => { if (client == null) return; const res = await fetchIfNotInState(store, client, key); - placeLayout( + placer( createLinePlot({ name: `Plot for ${res.name}`, ranges: { x1: [key], x2: [] }, @@ -233,14 +233,14 @@ const NoRanges = ({ onLinkClick }: NoRangesProps): ReactElement => { const List = (): ReactElement => { const menuProps = PMenu.useContextMenu(); const client = Synnax.use(); - const placeLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); const removeLayout = Layout.useRemover(); const dispatch = useDispatch(); const ranges = useSelectMultiple(); const activeRange = useSelect(); const handleCreate = (key?: string): void => - void placeLayout(createLayout({ initial: { key } })); + void placer(createLayout({ initial: { key } })); const handleRemove = (keys: string[]): void => void dispatch(remove({ keys })); @@ -306,11 +306,11 @@ const List = (): ReactElement => { const activeLayout = Layout.useSelectActiveMosaicLayout(); const addToActivePlot = useAddToActivePlot(); const addToNewPlot = useAddToNewPlot(); - const placeLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); const handleSetActive = () => void dispatch(setActive(key)); const handleViewDetails = useViewDetails(); const handleAddChildRange = () => - void placeLayout(createLayout({ initial: { parent: key } })); + void placer(createLayout({ initial: { parent: key } })); const rangeExists = rng != null; diff --git a/console/src/range/services/ontology.tsx b/console/src/range/services/ontology.tsx index 8624c7ceb..ec6aa4702 100644 --- a/console/src/range/services/ontology.tsx +++ b/console/src/range/services/ontology.tsx @@ -134,14 +134,13 @@ const useAddToNewPlot = (): ((props: Ontology.TreeContextMenuProps) => void) => }).mutate; const useViewDetails = (): ((props: Ontology.TreeContextMenuProps) => void) => { - const placeLayout = Layout.usePlacer(); - return ({ selection: { resources } }) => { - placeLayout({ + const placer = Layout.usePlacer(); + return ({ selection: { resources } }) => + placer({ ...overviewLayout, name: resources[0].name, key: resources[0].id.key, }); - }; }; const useDelete = (): ((props: Ontology.TreeContextMenuProps) => void) => { @@ -215,9 +214,9 @@ const TreeContextMenu: Ontology.TreeContextMenu = (props) => { const activate = useActivate(); const groupFromSelection = Group.useCreateFromSelection(); const handleLink = Link.useCopyToClipboard(); - const placeLayout = Layout.usePlacer(); + const placer = Layout.usePlacer(); const handleAddChildRange = () => - void placeLayout(createLayout({ initial: { parent: resources[0].id.key } })); + void placer(createLayout({ initial: { parent: resources[0].id.key } })); const viewDetails = useViewDetails(); const handleSelect = { delete: () => handleDelete(props),