mirror of
https://github.com/zhigang1992/firecms.git
synced 2026-06-15 01:58:59 +08:00
25 lines
685 B
TypeScript
25 lines
685 B
TypeScript
import React from "react";
|
|
import { Button } from "@material-ui/core";
|
|
import { Entity, useSnackbarController } from "@camberi/firecms";
|
|
|
|
export function SampleExtraActions({ selectedEntities }: {
|
|
selectedEntities?: Entity<any>[]
|
|
}) {
|
|
|
|
const snackbarContext = useSnackbarController();
|
|
|
|
const onClick = (event: React.MouseEvent) => {
|
|
const count = selectedEntities ? selectedEntities.length : 0;
|
|
snackbarContext.open({
|
|
type: "success",
|
|
message: `User defined code here! ${count} products selected`
|
|
});
|
|
};
|
|
return (
|
|
<Button onClick={onClick} color="primary">
|
|
Extra action
|
|
</Button>
|
|
);
|
|
|
|
}
|