import { Checkbox, Stack } from "@fluentui/react"; import { ThroughputInput } from "Explorer/Controls/ThroughputInput/ThroughputInput"; import { isFreeTierAccount } from "Explorer/Panes/AddCollectionPanel/AddCollectionPanelUtility"; import { useDatabases } from "Explorer/useDatabases"; import React from "react"; import { getCollectionName } from "Utils/APITypeUtils"; import { isServerlessAccount } from "Utils/CapabilityUtils"; export interface ThroughputComponentProps { enableDedicatedThroughput: boolean; setEnabledDedicatedThroughput: React.Dispatch>; isSelectedSourceContainerSharedThroughput: () => boolean; showCollectionThroughputInput: () => boolean; globalSecondaryIndexThroughputOnChange: (globalSecondaryIndexThroughputValue: number) => void; setIsThroughputCapExceeded: React.Dispatch>; isCostAknowledgedOnChange: (isCostAknowledgedValue: boolean) => void; } export const ThroughputComponent = (props: ThroughputComponentProps): JSX.Element => { const { enableDedicatedThroughput, setEnabledDedicatedThroughput, isSelectedSourceContainerSharedThroughput, showCollectionThroughputInput, globalSecondaryIndexThroughputOnChange, setIsThroughputCapExceeded, isCostAknowledgedOnChange, } = props; return ( {!isServerlessAccount() && isSelectedSourceContainerSharedThroughput() && ( setEnabledDedicatedThroughput(isChecked)} /> )} {showCollectionThroughputInput() && ( { globalSecondaryIndexThroughputOnChange(throughput); }} setIsAutoscale={() => {}} setIsThroughputCapExceeded={(isThroughputCapExceeded: boolean) => { setIsThroughputCapExceeded(isThroughputCapExceeded); }} onCostAcknowledgeChange={(isAcknowledged: boolean) => { isCostAknowledgedOnChange(isAcknowledged); }} /> )} ); };