/* * Vencord, a Discord client mod * Copyright (c) 2025 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import "./FormSwitch.css"; import { classes } from "@utils/misc"; import type { PropsWithChildren, ReactNode } from "react"; import { Divider } from "./Divider"; import { Span } from "./Span"; import { Switch } from "./Switch"; export interface FormSwitchProps { title: ReactNode; description?: ReactNode; value: boolean; onChange(value: boolean): void; className?: string; disabled?: boolean; hideBorder?: boolean; } export function FormSwitch({ onChange, title, value, description, disabled, className, hideBorder }: FormSwitchProps) { return ( {title} {description && {description}} {!hideBorder && } ); } // #region Old compatibility export function FormSwitchCompat({ note, children, ...restProps }: PropsWithChildren) { return ; } // #endregion