import { useParams } from "react-router-dom";

import { AccessModel } from "@/contracts/client.schemas";

import { Column } from "../../../common/components/Matrix/Column";
import { Matrix } from "../../../common/components/Matrix/Matrix";

export const AccessListPage = () => {
	const { memberId } = useParams();

	const columns: Column<AccessModel>[] = [
		{
			name: "assetGroupName",
			title: "Asset group name",
		},
	];

	return (
		<Matrix
			title="Accesses"
			columns={columns}
			baseUrl="/api/accesses"
			filters={{
				memberId,
			}}
			notificationMethodPrefix="ACCESSES"
			getModelTitle={(x) => x.username}
			canCreate={true}
			canView={true}
			canRemove={true}
		/>
	);
};
