/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import "./Notice.css"; import { classNameFactory } from "@utils/css"; import { classes } from "@utils/misc"; import type { ComponentPropsWithoutRef, ComponentType, ReactNode, SVGProps } from "react"; const cl = classNameFactory("vc-notice-"); export const NoticeVariants = ["info", "warning", "danger", "positive"] as const; export type NoticeVariant = typeof NoticeVariants[number]; export type NoticeProps = Omit, "children"> & { children: ReactNode; variant?: NoticeVariant; icon?: ComponentType>; action?: ReactNode; hidden?: boolean; }; function InfoIcon(props: SVGProps) { return ( ); } function WarningIcon(props: SVGProps) { return ( ); } function DangerIcon(props: SVGProps) { return ( ); } function PositiveIcon(props: SVGProps) { return ( ); } const DefaultIcons: Record>> = { info: InfoIcon, warning: WarningIcon, danger: DangerIcon, positive: PositiveIcon }; export function Notice({ children, variant = "info", icon, action, hidden = false, className, ...restProps }: NoticeProps) { const Icon = icon ?? DefaultIcons[variant]; return ( ); } Notice.Info = (props: Omit) => ; Notice.Warning = (props: Omit) => ; Notice.Danger = (props: Omit) => ; Notice.Positive = (props: Omit) => ;