@@ -3,7 +3,7 @@ import { ComposerContextLabel } from "./ComposerContextLabel";
33import { Tooltip , TooltipTrigger , TooltipPopup } from "./ui/tooltip" ;
44import type { EnvironmentId } from "@t3tools/contracts" ;
55import { ScaleIcon } from "lucide-react" ;
6- import { memo , useMemo } from "react" ;
6+ import { memo } from "react" ;
77
88import type { EnvironmentOption } from "./BranchToolbar.logic" ;
99import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon" ;
@@ -35,22 +35,18 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
3535 onEnvironmentChange,
3636} : BranchToolbarEnvironmentSelectorProps ) {
3737 const composerFloatingLayerProps = useComposerMenuProps ( ) ;
38- const activeEnvironment = useMemo ( ( ) => {
39- return availableEnvironments . find ( ( env ) => env . environmentId === environmentId ) ?? null ;
40- } , [ availableEnvironments , environmentId ] ) ;
38+ const activeEnvironment =
39+ availableEnvironments . find ( ( env ) => env . environmentId === environmentId ) ?? null ;
4140
42- const environmentItems = useMemo (
43- ( ) => [
44- ...( onAutoEnvironment
45- ? [ { value : "auto" , label : autoEnvironmentLabel ?? "Auto balance" } ]
46- : [ ] ) ,
47- ...availableEnvironments . map ( ( env ) => ( {
48- value : env . environmentId ,
49- label : env . label ,
50- } ) ) ,
51- ] ,
52- [ availableEnvironments , autoEnvironmentLabel , onAutoEnvironment ] ,
53- ) ;
41+ const environmentItems = [
42+ ...( onAutoEnvironment
43+ ? [ { value : "auto" , label : autoEnvironmentLabel ?? "Auto balance" } ]
44+ : [ ] ) ,
45+ ...availableEnvironments . map ( ( env ) => ( {
46+ value : env . environmentId ,
47+ label : env . label ,
48+ } ) ) ,
49+ ] ;
5450
5551 // The static label carries the xs control's height (h-7 sm:h-6) as well as
5652 // its padding: the composer context strip has no min-height of its own, and
0 commit comments