From dd6284d63444923933eda03fb967502c11e40fbb Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 26 Jun 2025 21:58:28 -0700 Subject: [PATCH] shared.tsx --- .../AssistantAndOrgListbox/shared.tsx | 105 +++++++++++++----- 1 file changed, 75 insertions(+), 30 deletions(-) diff --git a/gui/src/components/AssistantAndOrgListbox/shared.tsx b/gui/src/components/AssistantAndOrgListbox/shared.tsx index 1f57a4309..0cd897b5e 100644 --- a/gui/src/components/AssistantAndOrgListbox/shared.tsx +++ b/gui/src/components/AssistantAndOrgListbox/shared.tsx @@ -6,11 +6,8 @@ import { } from "@heroicons/react/24/outline"; import { useState } from "react"; import styled from "styled-components"; -import { - defaultBorderRadius, - lightGray, - vscCommandCenterInactiveBorder, -} from ".."; +import { lightGray } from ".."; +import { cn } from "../../util/cn"; import { ToolTip } from "../gui/Tooltip"; export const OptionDiv = styled.div<{ @@ -47,11 +44,6 @@ export const OptionDiv = styled.div<{ export const MAX_HEIGHT_PX = 300; -export const Divider = styled.div` - height: 0.5px; - background-color: ${vscCommandCenterInactiveBorder}; -`; - interface ModelOptionProps { children: React.ReactNode; idx: number; @@ -64,28 +56,81 @@ interface ModelOptionProps { onClickError?: (e: any) => void; } -const IconBase = styled.div<{ $hovered: boolean }>` - width: 1.2em; - height: 1.2em; - cursor: pointer; - padding: 4px; - border-radius: ${defaultBorderRadius}; - opacity: ${(props) => (props.$hovered ? 0.75 : 0)}; - visibility: ${(props) => (props.$hovered ? "visible" : "hidden")}; +interface IconBaseProps { + $hovered: boolean; + onClick?: (e: any) => void; + className?: string; + children?: React.ReactNode; + [key: string]: any; +} - &:hover { - opacity: 1; - background-color: ${lightGray}33; - } -`; +function IconBase({ + $hovered, + onClick, + className, + children, + ...props +}: IconBaseProps) { + return ( +
+ {children} +
+ ); +} -const StyledCog6ToothIcon = styled(IconBase).attrs({ as: Cog6ToothIcon })``; -const StyledArrowTopRightOnSquareIcon = styled(IconBase).attrs({ - as: ArrowTopRightOnSquareIcon, -})``; -const StyledExclamationTriangleIcon = styled(IconBase).attrs({ - as: ExclamationTriangleIcon, -})``; +const StyledCog6ToothIcon = ({ + $hovered, + onClick, +}: { + $hovered: boolean; + onClick?: (e: any) => void; +}) => ( + + + +); + +const StyledArrowTopRightOnSquareIcon = ({ + $hovered, + onClick, +}: { + $hovered: boolean; + onClick?: (e: any) => void; +}) => ( + + + +); + +const StyledExclamationTriangleIcon = ({ + $hovered, + onClick, + className, + ...props +}: { + $hovered: boolean; + onClick?: (e: any) => void; + className?: string; + [key: string]: any; +}) => ( + + + +); export function Option({ children,