import { Fact, useReplicache } from "src/replicache"; import { ButtonPrimary } from "components/Buttons"; import { CloseTiny } from "components/Icons/CloseTiny"; import { deleteBlock } from "src/utils/deleteBlock"; export const AreYouSure = (props: { entityID: string[] | string; onClick?: () => void; closeAreYouSure: () => void; type: Fact<"block/type">["data"]["value"] | undefined; compact?: boolean; }) => { let entities = [props.entityID].flat(); let { rep } = useReplicache(); return (
Delete{" "} {entities.length > 1 ? ( "Blocks" ) : props.type === "card" ? ( Page ) : props.type === "mailbox" ? ( Mailbox and Posts ) : ( Block )} ?{" "}
{ e.stopPropagation(); if (rep) await deleteBlock(entities, rep); }} > Delete
); };