fix(web): remove unused var in AppSidebar and drop ambient declaration for DetailLine (TS error)

This commit is contained in:
Esdras Renan 2025-10-10 12:05:04 -03:00
parent e3d6fea412
commit a4b31b0cb3
2 changed files with 3 additions and 4 deletions

View file

@ -42,9 +42,8 @@ type MachineSoftware = {
source?: string
}
// Forward declaration to ensure props are known before JSX usage
// Props type for DetailLine (used below)
type DetailLineProps = { label: string; value?: string | number | null; classNameValue?: string }
declare function DetailLine(props: DetailLineProps): JSX.Element
type LinuxExtended = {
lsblk?: unknown
@ -1340,7 +1339,7 @@ function MachineCard({ machine }: { machine: MachinesQueryItem }) {
)
}
function DetailLine({ label, value, classNameValue }: { label: string; value?: string | number | null; classNameValue?: string }) {
function DetailLine({ label, value, classNameValue }: DetailLineProps) {
if (value === null || value === undefined) return null
if (typeof value === "string" && (value.trim() === "" || value === "undefined" || value === "null")) {
return null

View file

@ -106,7 +106,7 @@ const navigation: { versions: string[]; navMain: NavigationGroup[] } = {
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
const pathname = usePathname()
const { session, isLoading, isAdmin, isStaff, convexUserId } = useAuth()
const { session, isLoading, isAdmin, isStaff } = useAuth()
const [isHydrated, setIsHydrated] = React.useState(false)
React.useEffect(() => {