import * as React from "react"
import { storiesOf } from "@storybook/react"
import * as common from "jamplay-common/client"
import { theme } from "../../.."
import BookReview from ".."
import { bookReview } from "./mock.data"
import ReviewSummary from "../ReviewSummary"
import { RatingStarInput } from "../RatingStarInput"
import ReviewItemInList from "../ReviewItemInList.component"
import ReviewList from "../ReviewList.component"
import ConfirmDeleteReviewDialog from "../ConfirmDeleteReviewDialog.component"
import { action } from "@storybook/addon-actions"
const providerOptions = {
theme,
}
let x = 0
export const getReview = () => (
{
_id: ++x + "",
rating: 4,
review: "1234",
isOwner: false,
createdAt: new Date(Date.now() - 3 * 60 * 1000).toISOString(),
user: {
_id: "1",
name: "art2",
profilePicture: null,
},
}
)
const manyReviews = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(getReview)
const reviews = [
{
_id: "1",
rating: 3,
review: "1234",
isOwner: false,
createdAt: new Date(Date.now() - 3 * 60 * 1000).toISOString(),
user: {
_id: "1",
name: "art",
profilePicture: null,
},
},
{
_id: "2",
rating: 4,
review: "1234",
isOwner: true,
createdAt: new Date(Date.now() - 3 * 60 * 1000).toISOString(),
user: {
_id: "1",
name: "art2",
profilePicture: null,
},
},
]
@common.provider(providerOptions)
class Provider extends React.Component {
public render() {
return this.props.children
}
}
storiesOf("Review", module)
.addDecorator((story) =>