2023-09-12 09:38:45 +00:00
|
|
|
import { useLoaderData, useParams, Link, Form } from "react-router-dom";
|
2023-09-06 15:14:50 +00:00
|
|
|
import Table from "../Components/Table";
|
|
|
|
import PageHeader from "../Components/PageHeader";
|
2023-09-07 08:07:38 +00:00
|
|
|
import { submissionsTableOptions } from "./submissions.jsx";
|
2023-09-11 10:03:49 +00:00
|
|
|
import { useState, useEffect } from "react";
|
2023-09-07 08:07:38 +00:00
|
|
|
|
2023-09-12 09:38:45 +00:00
|
|
|
const { filterList = [...filterList], highlights, clickables } = submissionsTableOptions
|
|
|
|
export default function Story() {
|
|
|
|
const { storyId } = useParams()
|
|
|
|
const { stories } = useLoaderData()
|
|
|
|
const storyData = stories.find(row => row.id == storyId)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2023-09-12 14:27:51 +00:00
|
|
|
<div id="page-container">
|
|
|
|
<PageHeader super={'Story#' + storyId} heading={storyData.title} url="/story" id={storyId}/>
|
2023-09-12 09:38:45 +00:00
|
|
|
<div>Wordcount: {storyData.word_count}</div>
|
|
|
|
<Table
|
|
|
|
data={storyData.submissions}
|
|
|
|
filterList={[...filterList, 'story']}
|
|
|
|
highlights={highlights}
|
|
|
|
clickables={clickables}
|
|
|
|
sortByDefault='date_submitted'
|
|
|
|
header='Submissions:'
|
|
|
|
></Table>
|
|
|
|
|
2023-09-13 09:50:57 +00:00
|
|
|
|
|
|
|
|
2023-09-12 09:38:45 +00:00
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)
|
2023-09-06 15:14:50 +00:00
|
|
|
}
|