11import type { Meta , StoryObj } from '@storybook/react' ;
2- import LocaleSelector from " @components/theme/LocaleSelector" ;
3- import { Locale } from " @lib/locale-resolver/LocaleResolver" ;
2+ import LocaleSelector from ' @components/theme/LocaleSelector' ;
3+ import { Locale } from ' @lib/locale-resolver/LocaleResolver' ;
44
55// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
6- const meta = {
6+ const meta : Meta < typeof LocaleSelector > = {
77 title : 'Components/LocaleSelector' ,
88 component : LocaleSelector ,
99 parameters : {
10- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
10+ // Optional parameter to center the component in the Canvas.
11+ // More info: https://storybook.js.org/docs/react/configure/story-layout
1112 layout : 'centered' ,
1213 } ,
13- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
14+ // This component will have an automatically generated Autodocs entry:
15+ // https://storybook.js.org/docs/react/writing-docs/autodocs
1416 tags : [ 'autodocs' ] ,
1517 // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
1618 argTypes : {
@@ -23,16 +25,18 @@ const meta = {
2325export default meta ;
2426type Story = StoryObj < typeof meta > ;
2527
26- const local_FR = { code : 'fr' , name : 'Français' } as Locale ;
27- const local_EN = { code : 'en' , name : 'English' } as Locale ;
28+ const LOCAL_FR : Locale = { code : 'fr' , name : 'Français' } as Locale ;
29+ const LOCAL_EN : Locale = { code : 'en' , name : 'English' } as Locale ;
2830
2931// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
3032export const Test : Story = {
3133 args : {
32- availableLocales : [ local_FR , local_EN ] ,
34+ availableLocales : [ LOCAL_FR , LOCAL_EN ] ,
3335 onLocaleSelected : ( ) => {
36+ // We can't use action here because it's a sample component
37+ // eslint-disable-next-line no-console
3438 console . log ( 'btn click' ) ;
3539 } ,
36- currentLocale : local_FR ,
40+ currentLocale : LOCAL_FR ,
3741 } ,
3842} ;
0 commit comments