renamed TableGen to EntityManagementTable

This commit is contained in:
Andreas 2024-06-25 08:20:04 +02:00
parent 395234f919
commit 83f1cd3dae
4 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ type Props = {
options?:TableGenOptions options?:TableGenOptions
} }
export default function TableGen(props:Props){ export default function EntityManagementTable(props:Props){
const options = props.options ? props.options : {editButton: true, deleteButton: true} const options = props.options ? props.options : {editButton: true, deleteButton: true}
console.log(props.headings) console.log(props.headings)
return <> return <>

View File

@ -9,7 +9,7 @@ import React, {
useLayoutEffect, useLayoutEffect,
useRef useRef
} from "react"; } from "react";
import TableGen from "../TableGen"; import EntityManagementTable from "../TableGen";
import toast from "react-hot-toast"; import toast from "react-hot-toast";
import PostEditor, { EditorProps } from "./PostEditor"; import PostEditor, { EditorProps } from "./PostEditor";
import { import {
@ -169,10 +169,10 @@ export default function PostTable(props: Props) {
} }
return <> return <>
<TableGen key="der-table" headings={props.headings}> <EntityManagementTable key="der-table" headings={props.headings}>
{posts.map((postData: Partial<PostAttributesWithBuckets>) => <TableRow headings={props.headings} {posts.map((postData: Partial<PostAttributesWithBuckets>) => <TableRow headings={props.headings}
postData={postData} postData={postData}
key={postData.id}/> )} key={postData.id}/> )}
</TableGen> </EntityManagementTable>
</> </>
} }

View File

@ -3,7 +3,7 @@ cache: 'no-store'
import { tryFetchPosts } from "@/app/api/post/route"; import { tryFetchPosts } from "@/app/api/post/route";
import { constructAPIUrl } from "@/util/Utils"; import { constructAPIUrl } from "@/util/Utils";
import { ReactNode, useEffect } from "react"; import { ReactNode, useEffect } from "react";
import TableGen from "../../../client/TableGen"; import EntityManagementTable from "../../../client/TableGen";
import PostTable from "@/components/client/admin/PostTable"; import PostTable from "@/components/client/admin/PostTable";
import { deletePost, getPostsWithBuckets, updatePost } from "@/app/lib/actions/entityManagement/postActions"; import { deletePost, getPostsWithBuckets, updatePost } from "@/app/lib/actions/entityManagement/postActions";
import { getProjects } from "@/app/lib/actions/entityManagement/projectActions"; import { getProjects } from "@/app/lib/actions/entityManagement/projectActions";

View File

@ -3,7 +3,7 @@ cache: 'no-store'
import { tryFetchPosts } from "@/app/api/post/route"; import { tryFetchPosts } from "@/app/api/post/route";
import { constructAPIUrl } from "@/util/Utils"; import { constructAPIUrl } from "@/util/Utils";
import { ReactNode, useEffect } from "react"; import { ReactNode, useEffect } from "react";
import TableGen from "../../../client/TableGen"; import EntityManagementTable from "../../../client/TableGen";
import PostTable from "@/components/client/admin/PostTable"; import PostTable from "@/components/client/admin/PostTable";
import { deletePost, getPostsWithBuckets, updatePost } from "@/app/lib/actions/entityManagement/postActions"; import { deletePost, getPostsWithBuckets, updatePost } from "@/app/lib/actions/entityManagement/postActions";
import { getProjects } from "@/app/lib/actions/entityManagement/projectActions"; import { getProjects } from "@/app/lib/actions/entityManagement/projectActions";
@ -53,7 +53,7 @@ export default async function ProjectView(props:Props){
a.push(key) a.push(key)
} }
// return a.map((e)=> <div key={e}>{e}</div> ); // return a.map((e)=> <div key={e}>{e}</div> );
return <TableGen headings={a}><></></TableGen> return <EntityManagementTable headings={a}><></></EntityManagementTable>
})()} })()}
{/* <PostTable data={posts} {/* <PostTable data={posts}
projects={projects} projects={projects}