File tree 1 file changed +31
-0
lines changed
packages/nextjs/src/components/_common/lenke/lenkeBase
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Meta , StoryObj } from '@storybook/react' ;
3
+ import { PageContextProvider } from 'store/pageContext' ;
4
+ import { adminPreviewUrlPrefix , LenkeBase } from './LenkeBase' ;
5
+
6
+ const withMockedPageContent = ( Story : any ) => (
7
+ < PageContextProvider content = { { editorView : 'edit' } } >
8
+ < Story />
9
+ </ PageContextProvider >
10
+ ) ;
11
+ const meta : Meta < typeof LenkeBase > = {
12
+ component : LenkeBase ,
13
+ decorators : [ withMockedPageContent ] ,
14
+ } ;
15
+
16
+ export default meta ;
17
+ type Story = StoryObj < typeof LenkeBase > ;
18
+
19
+ export const Default : Story = {
20
+ args : {
21
+ href : '/' ,
22
+ children : 'Trykk her' ,
23
+ } ,
24
+ } ;
25
+
26
+ export const BadLinkWarning : Story = {
27
+ args : {
28
+ href : adminPreviewUrlPrefix ,
29
+ children : 'Trykk her' ,
30
+ } ,
31
+ } ;
You can’t perform that action at this time.
0 commit comments