diff --git a/web/src/components/ChangelogDetails/ChangelogDetails.stories.tsx b/web/src/components/ChangelogDetails/ChangelogDetails.stories.tsx new file mode 100644 index 0000000..aad1a81 --- /dev/null +++ b/web/src/components/ChangelogDetails/ChangelogDetails.stories.tsx @@ -0,0 +1,26 @@ +// Pass props to your component by passing an `args` object to your story +// +// ```tsx +// export const Primary: Story = { +// args: { +// propName: propValue +// } +// } +// ``` +// +// See https://storybook.js.org/docs/react/writing-stories/args. + +import type { Meta, StoryObj } from '@storybook/react' + +import ChangelogDetails from './ChangelogDetails' + +const meta: Meta = { + component: ChangelogDetails, + tags: ['autodocs'], +} + +export default meta + +type Story = StoryObj + +export const Primary: Story = {} diff --git a/web/src/components/ChangelogDetails/ChangelogDetails.test.tsx b/web/src/components/ChangelogDetails/ChangelogDetails.test.tsx new file mode 100644 index 0000000..47ba156 --- /dev/null +++ b/web/src/components/ChangelogDetails/ChangelogDetails.test.tsx @@ -0,0 +1,14 @@ +import { render } from '@redwoodjs/testing/web' + +import ChangelogDetails from './ChangelogDetails' + +// Improve this test with help from the Redwood Testing Doc: +// https://redwoodjs.com/docs/testing#testing-components + +describe('ChangelogDetails', () => { + it('renders successfully', () => { + expect(() => { + render() + }).not.toThrow() + }) +}) diff --git a/web/src/components/ChangelogDetails/ChangelogDetails.tsx b/web/src/components/ChangelogDetails/ChangelogDetails.tsx new file mode 100644 index 0000000..8596fcf --- /dev/null +++ b/web/src/components/ChangelogDetails/ChangelogDetails.tsx @@ -0,0 +1,14 @@ +import { prettifyDate } from 'src/helpers/DateHelpers' + +const ChangelogDetails = ({ children, date }) => { + return ( +
+ + {prettifyDate(date)} + + {children} +
+ ) +} + +export default ChangelogDetails