2023-09-06 15:14:50 +00:00
|
|
|
import { useLoaderData, useParams } from "react-router-dom";
|
|
|
|
import Table from "../Components/Table";
|
|
|
|
import PageHeader from "../Components/PageHeader";
|
2023-09-07 08:07:38 +00:00
|
|
|
import { submissionsTableOptions } from "./submissions.jsx";
|
|
|
|
|
|
|
|
const { filterList=[...filterList],highlights,clickables } = submissionsTableOptions
|
2023-09-06 15:14:50 +00:00
|
|
|
export default function Story(){
|
|
|
|
const { storyId } = useParams()
|
|
|
|
const { stories } = useLoaderData()
|
2023-09-06 20:49:09 +00:00
|
|
|
const storyData = stories.find(row=>row.id==storyId)
|
2023-09-07 08:07:38 +00:00
|
|
|
filterList.push(
|
|
|
|
'story',
|
|
|
|
|
|
|
|
)
|
2023-09-06 15:14:50 +00:00
|
|
|
return(
|
|
|
|
<>
|
|
|
|
<PageHeader text={'Story#'+storyId}/>
|
|
|
|
{JSON.stringify(storyData)}
|
2023-09-07 08:07:38 +00:00
|
|
|
<Table
|
|
|
|
data={storyData.submissions}
|
|
|
|
filterList={filterList}
|
|
|
|
highlights={highlights}
|
|
|
|
clickables={clickables}
|
|
|
|
sortByDefault='date_submitted'
|
|
|
|
></Table>
|
2023-09-06 15:14:50 +00:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|