-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathReadMarker.stories.tsx
More file actions
60 lines (52 loc) · 1.42 KB
/
ReadMarker.stories.tsx
File metadata and controls
60 lines (52 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import React, { type JSX } from "react";
import { fn } from "storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { ReadMarker, type ReadMarkerProps } from "./ReadMarker";
const ReadMarkerWrapper = ({
className,
onCurrentMarkerRef,
onGhostLineRef,
onGhostTransitionEnd,
...props
}: Readonly<ReadMarkerProps>): JSX.Element => {
return (
<ul>
<ReadMarker
{...props}
className={className}
onCurrentMarkerRef={onCurrentMarkerRef ?? fn()}
onGhostLineRef={onGhostLineRef ?? fn()}
onGhostTransitionEnd={onGhostTransitionEnd ?? fn()}
/>
</ul>
);
};
const meta = {
title: "Timeline/Timeline Meta/ReadMarker",
component: ReadMarkerWrapper,
tags: ["autodocs"],
args: {
eventId: "$event",
kind: "current",
showLine: true,
},
} satisfies Meta<typeof ReadMarkerWrapper>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Current: Story = {};
export const HiddenCurrent: Story = {
args: {
showLine: false,
},
};
export const Ghost: Story = {
args: {
kind: "ghost",
},
};