Download tabler-react/src/components/Notification/Notification.react.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Notification/Notification.react.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Notification/Notification.react.js
-
curl -L -o Notification.react.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Notification/Notification.react.js
1.03 kB
| // @flow | |
| import * as React from "react"; | |
| import { Avatar, Text } from "../"; | |
| import NotificationTray from "./NotificationTray.react"; | |
| export type Props = {| | |
| /** | |
| * The avatar image URL | |
| */ | |
| +avatarURL?: string, | |
| /** | |
| * The message displayed within the Notification | |
| */ | |
| +message: React.Node, | |
| /** | |
| * The time displayed within the Notification | |
| */ | |
| +time?: string, | |
| /** | |
| * Indicate the notification as unread | |
| */ | |
| +unread?: boolean, | |
| |}; | |
| /** | |
| * An individual Notification made up of an Avatar alongside some text and the time | |
| */ | |
| function Notification({ avatarURL, message, time, unread }: Props): React.Node { | |
| return ( | |
| <React.Fragment> | |
| {avatarURL && ( | |
| <Avatar className="mr-3 align-self-center" imageURL={avatarURL} /> | |
| )} | |
| <div> | |
| {message} | |
| {time && ( | |
| <Text color="muted" size="small"> | |
| {time} | |
| </Text> | |
| )} | |
| </div> | |
| </React.Fragment> | |
| ); | |
| } | |
| Notification.Tray = NotificationTray; | |
| export default Notification; | |