Path: blob/master/src/packages/frontend/components/dnd/drag-overlay-content.tsx
10799 views
// Generic drag overlay label shown next to the cursor during DnD.1// Used by both file explorer and frame editor for consistent appearance.23import { Icon, type IconName } from "@cocalc/frontend/components/icon";4import { COLORS } from "@cocalc/util/theme";5import { DRAG_OVERLAY_STYLE } from "./config";67type Variant = "valid" | "neutral" | "invalid";89const VARIANT_COLORS: Record<Variant, string> = {10valid: `${COLORS.ANTD_LINK_BLUE}e0`,11neutral: `${COLORS.GRAY_D}d0`,12invalid: `${COLORS.ANTD_RED}e0`,13};1415interface Props {16icon: IconName;17text: string;18variant: Variant;19}2021export function DragOverlayContent({ icon, text, variant }: Props) {22return (23<div24style={{25...DRAG_OVERLAY_STYLE,26background: VARIANT_COLORS[variant],27color: COLORS.WHITE,28}}29>30<Icon name={icon} style={{ marginRight: 6 }} />31{text}32</div>33);34}353637