Skip to content

Commit e1b36cd

Browse files
zombieJclaude
andcommitted
refactor: simplify Notification component and add new props
- Remove unused props: children, icon, title - Add duration, pauseOnHover, onClick props - Simplify component structure Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 2b539d5 commit e1b36cd

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/Notification.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
import * as React from 'react';
22

33
export interface NotificationProps {
4-
children?: React.ReactNode;
5-
icon?: React.ReactNode;
6-
title?: React.ReactNode;
74
content?: React.ReactNode;
85
actions?: React.ReactNode;
96
close?: React.ReactNode;
7+
duration?: number | false | null;
8+
pauseOnHover?: boolean;
9+
onClick?: React.MouseEventHandler<HTMLDivElement>;
1010
}
1111

1212
const Notification = React.forwardRef<HTMLDivElement, NotificationProps>((props, ref) => {
13-
const { children, icon, title, content, actions, close, ...restProps } = props;
13+
const { content, actions, close, ...restProps } = props;
1414
return (
1515
<div ref={ref} {...restProps}>
16-
{icon && <div className="icon">{icon}</div>}
17-
{title && <div className="title">{title}</div>}
16+
{content}
1817
{close && (
1918
<button className="close" aria-label="Close">
2019
{close}
2120
</button>
2221
)}
23-
{content && <div className="content">{content}</div>}
2422
{actions && <div className="actions">{actions}</div>}
2523
</div>
2624
);

0 commit comments

Comments
 (0)