import { useState, useEffect } from "react"; import { useParams } from "react-router"; import useDebounce from "../../../hooks/useDebounce"; export const GeneralDetails = ({ releaseName, namespace = "", disabled, onNamespaceInput, onReleaseNameInput, }: { releaseName: string; namespace?: string; disabled: boolean; onNamespaceInput: (namespace: string) => void; onReleaseNameInput: (chartName: string) => void; }) => { const [namespaceInputValue, setNamespaceInputValue] = useState(namespace); const namespaceInputValueDebounced = useDebounce( namespaceInputValue, 500 ); useEffect(() => { onNamespaceInput(namespaceInputValueDebounced); }, [namespaceInputValueDebounced, onNamespaceInput]); const { context } = useParams(); const inputClassName = ` text-lg py-1 px-2 border border-1 border-gray-300 ${ disabled ? "bg-gray-200" : "bg-white " } rounded-sm`; return (

Release name:

onReleaseNameInput(e.target.value)} >

Namespace (optional):

setNamespaceInputValue(e.target.value)} >
{context ? (

Cluster:

{context}

) : null}
); };