mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
* Bump lint-staged * Check * Check * Added husky * Check * Check * Check * Check * Check * Check * Check * Check * Fix husky * Used * instead **/* in lint-staged * Bump tailwindcss and related * Added @tailwindcss/vite and removed postcss * Added lint into staged * Bump @babel/core and updated .prettierignore * Removed tailwind.config.cjs * Added ThemeInit * Added cursor-pointer to Help dropdown * Bump react-router * Removed @types/uuid and react-router-dom * Bump diff2html, prettier, @typescript-eslint/eslint-plugin, @typescript-eslint/parser * removed vite-plugin-html-config and @babel/core * removed "@eslint/eslintrc" and "@eslint/js" * Removed redundant link * Returned plugins and source to index.css * Set dark to false in tailwindcss * Fixed storybook * Fixed useGetLatestVersion with correct gcTime: 0 option * Added eslint-plugin-prettier * Removed spaces * ClustersList.tsx improved and type fixes for another files * Repository.tsx improved * Huge fix of types * Huge fix of types missed * Fixed type of SingleValue * Added cursor pointer
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
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<string>(
|
|
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 (
|
|
<div className="flex gap-8">
|
|
<div>
|
|
<h4 className="text-lg">Release name:</h4>
|
|
<input
|
|
className={inputClassName}
|
|
value={releaseName}
|
|
disabled={disabled}
|
|
onChange={(e) => onReleaseNameInput(e.target.value)}
|
|
></input>
|
|
</div>
|
|
<div>
|
|
<h4 className="text-lg">Namespace (optional):</h4>
|
|
<input
|
|
className={inputClassName}
|
|
value={namespaceInputValue}
|
|
disabled={disabled}
|
|
onChange={(e) => setNamespaceInputValue(e.target.value)}
|
|
></input>
|
|
</div>
|
|
{context ? (
|
|
<div className="flex">
|
|
<h4 className="text-lg">Cluster:</h4>
|
|
<p className="text-lg">{context}</p>
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
);
|
|
};
|