mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
22 lines
830 B
TypeScript
22 lines
830 B
TypeScript
import { NotificationAlertItem, NotificationAlertType } from '../../../../api';
|
|
import { NitroSystemAlertView } from './NitroSystemAlertView';
|
|
import { NotificationDefaultAlertView } from './NotificationDefaultAlertView';
|
|
import { NotificationSeachAlertView } from './NotificationSearchAlertView';
|
|
|
|
export const GetAlertLayout = (item: NotificationAlertItem, onClose: () => void) =>
|
|
{
|
|
if(!item) return null;
|
|
|
|
const key = item.id;
|
|
const props = { item, onClose };
|
|
|
|
switch(item.alertType)
|
|
{
|
|
case NotificationAlertType.NITRO:
|
|
return <NitroSystemAlertView key={key} {...props} />;
|
|
case NotificationAlertType.SEARCH:
|
|
return <NotificationSeachAlertView key={key} {...props} />;
|
|
default:
|
|
return <NotificationDefaultAlertView key={key} {...props} />;
|
|
}
|
|
} |