Files
calendar/packages/ui/components/data-table/DataTableSelectionBar.tsx
T
Alex van AndelandGitHub b9128a7a0b chore: Add ./components/[name]/index.ts map to package.json (#17319)
* chore: Add ./components/[name]/index.ts map to package.json

* fix: Clarify Popover exports

* fix: re-add dropdown to calcom/ui barrel

* chore: Add icon barrel file re-export

* Fix all calcom/ui imports of its own barrel

* Never say 'fix all remaining..' it's never true

* Some type fixeS

* Linking fixes

* Rename sheet.tsx to Sheet.tsx

Done through UI, console does NOT like this.

* Fixed some test failures
2024-10-25 23:05:29 +01:00

47 lines
1.0 KiB
TypeScript

"use client";
import type { Table } from "@tanstack/react-table";
import { forwardRef } from "react";
import { classNames } from "@calcom/lib";
import type { IconName } from "../icon";
export type ActionItem<TData> =
| {
type: "action";
label: string;
onClick: () => void;
icon?: IconName;
needsXSelected?: number;
}
| {
type: "render";
render: (table: Table<TData>) => React.ReactNode;
needsXSelected?: number;
};
const Root = forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & { showSelectionCount?: boolean }
>(({ children, ...props }, ref) => {
return (
<div
ref={ref}
className={classNames(
"bg-brand-default text-brand fixed bottom-4 left-1/2 flex w-fit -translate-x-1/2 transform items-center space-x-3 rounded-lg px-4 py-2",
props.className
)}
style={{ ...props.style }}
{...props}>
{children}
</div>
);
});
Root.displayName = "Root";
export const DataTableSelectionBar = {
Root,
};