This commit is contained in:
2025-06-17 17:41:04 +05:00
parent 59c3080332
commit ccfa6ea260
6 changed files with 27 additions and 36 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ function Button({
onClick?.(e);
}}
className={clsx(
"transition-all flex outline-none 2xl:gap-[0.556vw] gap-2 items-center justify-center font-medium disabled:bg-[#F6F6F6] disabled:text-[#D6D6D6] cursor-pointerdisabled:cursor-default",
"transition-all flex outline-none 2xl:gap-[0.556vw] gap-2 items-center justify-center font-medium disabled:bg-[#F6F6F6] disabled:text-[#D6D6D6]",
variant === "critical" &&
"text-[#FF4517] bg-[#FEF3F2] hover:bg-[#FEE4E2]",
variant === "secondary" &&
+4
View File
@@ -20,6 +20,10 @@ function ProjectSelector({
setSelectedProject,
activeProject,
}: Props) {
useEffect(() => {
console.log(projects);
}, [projects]);
const [isOpen, setIsOpen] = useState(false);
const [pointedProject, setPointedProject] = useState<IApp | null>(null);
+9 -26
View File
@@ -1,15 +1,14 @@
import React, { useRef } from "react";
import SearchIcon from "./icons/SearchIcon";
import CloseIcon from "./icons/CloseIcon";
import Button from "./Button";
import clsx from "clsx";
function SearchInput(
props: React.InputHTMLAttributes<HTMLInputElement> & {
onEnter?: () => void;
setSearch: React.Dispatch<React.SetStateAction<string | null>>;
}
) {
// const [value, setValue] = useState();
const ref = useRef<HTMLInputElement>(null);
return (
@@ -26,9 +25,6 @@ function SearchInput(
className="outline-none focus:outline-none placeholder:button-m placeholder:font-medium placeholder:text-[#7D7D7D] button-m font-medium flex-1"
{...props}
ref={ref}
onKeyDown={(e) => {
if (e.key === "Enter") props.onEnter?.();
}}
/>
</div>
<div
@@ -40,31 +36,18 @@ function SearchInput(
<button
disabled={!props.value}
className="outline-none cursor-pointer disabled:cursor-default"
// onClick={() => {
// if (ref.current) {
// ref.current.value = "";
// ref.current.focus();
// }
// }}
onClick={() => {
if (ref.current) {
ref.current.value = "";
ref.current.focus();
props.setSearch(ref.current.value);
}
}}
>
<div
className="text-[#7D7D7D] size-[1.111vw]"
onClick={() => {
if (ref.current) {
ref.current.value = "";
ref.current.focus();
props.setSearch(ref.current.value);
}
}}
>
<div className="text-[#7D7D7D] size-[1.111vw]">
<CloseIcon />
</div>
</button>
{/* {pr ops.onEnter && (
<Button size="small" disabled={!props.value} onClick={props.onEnter}>
Искать
</Button>
)} */}
</div>
</div>
);
+4 -2
View File
@@ -42,7 +42,9 @@ export default function CreateSessionModal({ targetServerId }: Props) {
useEffect(() => {
setSelectedApp(
selectedServer?.sessions?.[0]?.app || selectedServer?.apps?.[0] || null
selectedServer?.sessions?.[0]?.app ||
selectedServer?.apps?.[0].app ||
null
);
}, [selectedServer]);
@@ -204,7 +206,7 @@ export default function CreateSessionModal({ targetServerId }: Props) {
? selectedApp
: null
}
projects={selectedServer?.apps}
projects={selectedServer?.apps.map(({ app }) => app)}
selectedProject={selectedApp}
setSelectedProject={setSelectedApp}
/>