mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-23 05:17:49 -05:00
Add Loader in Product Delete button and tweak Weekly Summary UI
Add Loader in Product Delete button and tweak Weekly Summary UI
This commit is contained in:
@@ -125,6 +125,7 @@ export function DeleteProduct({ environmentId }) {
|
||||
const router = useRouter();
|
||||
|
||||
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
|
||||
const [deletingProduct, setDeletingProduct] = useState(false);
|
||||
|
||||
const { profile } = useProfile();
|
||||
const { team } = useMembers(environmentId);
|
||||
@@ -149,7 +150,9 @@ export function DeleteProduct({ environmentId }) {
|
||||
setIsDeleteDialogOpen(false);
|
||||
return;
|
||||
}
|
||||
setDeletingProduct(true);
|
||||
const deleteProductRes = await deleteProduct(environmentId);
|
||||
setDeletingProduct(false);
|
||||
|
||||
if (deleteProductRes?.id?.length > 0) {
|
||||
toast.success("Product deleted successfully.");
|
||||
@@ -191,6 +194,7 @@ export function DeleteProduct({ environmentId }) {
|
||||
deleteWhat="Product"
|
||||
open={isDeleteDialogOpen}
|
||||
setOpen={setIsDeleteDialogOpen}
|
||||
isDeleting={deletingProduct}
|
||||
onDelete={handleDeleteProduct}
|
||||
text={`Are you sure you want to delete "${truncate(
|
||||
product?.name,
|
||||
|
||||
@@ -144,7 +144,7 @@ const createSurveyFields = (surveryResponses: SurveyResponse[]) => {
|
||||
surveyFields += `
|
||||
<div style="margin-top:1em;">
|
||||
<p style="margin:0px;">${headline}</p>
|
||||
<p style="font-weight: 500; margin:0px;">${answer}</p>
|
||||
<p style="font-weight: bold; margin:0px;">${answer}</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user