mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-07 07:09:28 -06:00
* revert to last working version * add updated ui components * update formbricks-com components * apply prettier formatting * update apps/web files
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import React from "react";
|
|
import { Card } from "@formbricks/ui";
|
|
import type { CardProps } from "@formbricks/ui";
|
|
|
|
import { TrashIcon, PencilSquareIcon } from "@heroicons/react/24/outline";
|
|
|
|
interface AlertCardProps extends CardProps {
|
|
onDelete?: () => void;
|
|
onEdit?: () => void;
|
|
}
|
|
|
|
const AlertCard: React.FC<AlertCardProps> = ({ title, description, icon, onDelete, onEdit }) => (
|
|
<div className="relative">
|
|
<div className="absolute right-6 top-6">
|
|
{onDelete && (
|
|
<button
|
|
type="button"
|
|
onClick={(e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
onDelete();
|
|
}}>
|
|
<TrashIcon className="mr-2 h-7 w-7 p-1 text-slate-500 hover:text-red-600" />
|
|
</button>
|
|
)}
|
|
{onEdit && (
|
|
<button
|
|
type="button"
|
|
onClick={(e) => {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
onEdit();
|
|
}}>
|
|
<PencilSquareIcon className="h-7 w-7 p-1 text-slate-500 hover:text-slate-800" />
|
|
</button>
|
|
)}
|
|
</div>
|
|
<Card onClick={onEdit} title={title} description={description} icon={icon} className="w-full" />
|
|
</div>
|
|
);
|
|
|
|
export default AlertCard;
|