2023-09-06 15:14:50 +00:00
|
|
|
import { useLoaderData } from "react-router-dom";
|
|
|
|
import { getSubmissions } from "../APIcalls.mjs";
|
|
|
|
import Table from "../Components/Table";
|
|
|
|
import PageHeader from "../Components/PageHeader";
|
|
|
|
|
2023-09-07 08:07:38 +00:00
|
|
|
export const submissionsTableOptions = {
|
|
|
|
filterList : [
|
|
|
|
'response_id',
|
|
|
|
'pub_id',
|
|
|
|
'story_id'
|
|
|
|
],
|
|
|
|
highlights : [
|
|
|
|
['response','Pending']
|
|
|
|
],
|
|
|
|
clickables : [
|
|
|
|
['story',(row)=>{
|
|
|
|
return `../../story/${row.story_id}`}],
|
|
|
|
['publication',(row)=>{return `../../publication/${row.pub_id}`}]
|
|
|
|
]
|
|
|
|
}
|
2023-09-06 15:14:50 +00:00
|
|
|
|
2023-09-07 08:07:38 +00:00
|
|
|
export function Submissions(){
|
2023-09-06 15:14:50 +00:00
|
|
|
const { submissions } = useLoaderData();
|
|
|
|
const filterList = [
|
|
|
|
'response_id',
|
|
|
|
'pub_id',
|
|
|
|
'story_id'
|
|
|
|
]
|
|
|
|
const highlights = [
|
2023-09-06 16:54:58 +00:00
|
|
|
['response','Pending']
|
2023-09-06 15:14:50 +00:00
|
|
|
]
|
|
|
|
const clickables = [
|
2023-09-06 16:54:58 +00:00
|
|
|
['story',(row)=>{
|
2023-09-06 15:14:50 +00:00
|
|
|
return `../../story/${row.story_id}`}],
|
2023-09-06 16:54:58 +00:00
|
|
|
['publication',(row)=>{return `../../publication/${row.pub_id}`}]
|
2023-09-06 15:14:50 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
return(
|
|
|
|
<>
|
|
|
|
<PageHeader text="Submissions"/>
|
|
|
|
<Table
|
|
|
|
data={submissions}
|
|
|
|
filterList={filterList}
|
|
|
|
highlights={highlights}
|
2023-09-07 08:07:38 +00:00
|
|
|
sortByDefault="date_submitted"
|
2023-09-06 15:14:50 +00:00
|
|
|
clickables={clickables}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|