Skip to content

Commit

Permalink
Fix linter error in page container
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardLinS committed May 27, 2024
1 parent 81dce80 commit 5c6f9b6
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions admin-portal-frontend/src/app/components/PageContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
"use client";

import React, { useState } from "react";
import { Category } from "./categoryRoutes";
import TrashIcon from "../icons/trash.svg";

import EditIcon from "../icons/edit.svg";
import TrashIcon from "../icons/trash.svg";

import DeleteConfirmationPopup from "./DeletePopup";

import { Category } from "./categoryRoutes";

type IconProps = {
'content-type': string,
src: string
}

type PageItemProps = {
id: string;
title: string;
Expand All @@ -23,13 +31,13 @@ const PageItem: React.FC<PageItemProps> = ({ id, page, title, onDeleteCategory }
setPopupVisible(true);
};

const handleConfirmDelete = async () => {
const handleConfirmDelete = () => {
try {
onDeleteCategory(id);
console.log("Category deleted:", id);
console.log("Page deleted:", id);
setPopupVisible(false);
} catch (error) {
console.error("Error deleting category:", error);
console.error("Error deleting page:", error);
}
};

Expand Down Expand Up @@ -63,11 +71,11 @@ const PageItem: React.FC<PageItemProps> = ({ id, page, title, onDeleteCategory }
setAllowEdits(!allowEdits);
}}
>
<img src={EditIcon.src} alt="Edit" className="w-4 h-4" />
<img src={( EditIcon as IconProps ).src} alt="Edit" className="w-4 h-4" />
</button>
<button className="bg-[#E5EFF5] p-2 rounded-full border border-black">
<img
src={TrashIcon.src}
src={( TrashIcon as IconProps ).src}
alt="Delete"
className="w-4 h-4"
onClick={() => {
Expand Down

0 comments on commit 5c6f9b6

Please sign in to comment.