"use client"; import type { Table } from "@tanstack/react-table"; import { forwardRef } from "react"; import { createPortal } from "react-dom"; import classNames from "@calcom/ui/classNames"; import { Button, type ButtonProps } from "@calcom/ui/components/button"; import { Icon, type IconName } from "@calcom/ui/components/icon"; export type ActionItem = | { type: "action"; label: string; onClick: () => void; icon?: IconName; needsXSelected?: number; } | { type: "render"; render: (table: Table) => React.ReactNode; needsXSelected?: number; }; type ResponsiveButtonProps = { className?: string; icon: IconName; onClick?: () => void; children: string; } & ButtonProps; const ResponsiveButton = forwardRef( ({ icon, onClick, children, ...rest }, ref) => { return ( ); } ); ResponsiveButton.displayName = "ResponsiveButton"; const Root = forwardRef< HTMLDivElement, React.HTMLAttributes & { showSelectionCount?: boolean } >(({ children, ...props }, ref) => { const { className, style, ...rest } = props; return createPortal(
{children}
, document.body ); }); Root.displayName = "Root"; export const DataTableSelectionBar = { Root, Button: ResponsiveButton, };