ui updates for permissions.
This commit is contained in:
@@ -7,7 +7,7 @@ import { Permission } from "@/interfaces/permissions";
|
||||
import { getPermissionDocs } from "@/utils/permissions.be";
|
||||
import { User } from "@/interfaces/user";
|
||||
import Layout from "@/components/High/Layout";
|
||||
import Link from "next/link";
|
||||
import PermissionList from '@/components/PermissionList'
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(async ({ req }) => {
|
||||
const user = req.session.user;
|
||||
@@ -33,7 +33,6 @@ export const getServerSideProps = withIronSessionSsr(async ({ req }) => {
|
||||
// Fetch data from external API
|
||||
const permissions: Permission[] = await getPermissionDocs();
|
||||
|
||||
console.log("Permissions", permissions);
|
||||
|
||||
// const res = await fetch("api/permissions");
|
||||
// const permissions: Permission[] = await res.json();
|
||||
@@ -56,10 +55,9 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function Page(props: Props) {
|
||||
console.log("Props", props);
|
||||
|
||||
|
||||
const { permissions, user } = props;
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -74,19 +72,7 @@ export default function Page(props: Props) {
|
||||
<Layout user={user} className="gap-6">
|
||||
<h1 className="text-2xl font-semibold">Permissions</h1>
|
||||
<div className="flex gap-3 flex-wrap">
|
||||
{permissions.map((permission: Permission) => {
|
||||
const id = permission.id as string;
|
||||
const type = permission.type as string;
|
||||
return (
|
||||
<Link href={`/permissions/${id}`} key={id}>
|
||||
<div className="card bg-primary text-primary-content">
|
||||
<div className="card-body">
|
||||
<h1 className="card-title">{type}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
<PermissionList permissions={permissions} />
|
||||
</div>
|
||||
</Layout>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user