mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
feat(component): add storybook (#5079)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { Button } from '../button';
|
||||
import { toast } from '.';
|
||||
|
||||
export default {
|
||||
title: 'UI/Toast',
|
||||
component: () => null,
|
||||
};
|
||||
|
||||
export const Default = () => {
|
||||
const [count, setCount] = useState(1);
|
||||
|
||||
const showToast = useCallback(() => {
|
||||
toast(`Toast ${count}`);
|
||||
setCount(count + 1);
|
||||
}, [count]);
|
||||
|
||||
return <Button onClick={showToast}>Show toast</Button>;
|
||||
};
|
||||
Reference in New Issue
Block a user