sub-manager-frontend/src/routes/story.jsx

27 lines
847 B
React
Raw Normal View History

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()
const storyData = stories.find(row=>row.id==storyId)
2023-09-10 15:01:05 +00:00
2023-09-06 15:14:50 +00:00
return(
<>
2023-09-10 15:01:05 +00:00
<div id="page">
<PageHeader super={'Story#'+storyId} heading={storyData.title}/>
2023-09-07 08:07:38 +00:00
<Table
data={storyData.submissions}
2023-09-10 15:01:05 +00:00
filterList={[...filterList,'story']}
2023-09-07 08:07:38 +00:00
highlights={highlights}
clickables={clickables}
sortByDefault='date_submitted'
2023-09-10 15:01:05 +00:00
header='Submissions:'
2023-09-07 08:07:38 +00:00
></Table>
2023-09-10 15:01:05 +00:00
</div>
2023-09-06 15:14:50 +00:00
</>
)
}