UNPKG

@parsifal-m/plugin-dev-quotes-homepage

Version:

A backstage plugin to render a developer themed quote

25 lines (22 loc) 856 B
import { jsxs, jsx } from 'react/jsx-runtime'; import { makeStyles, Typography } from '@material-ui/core'; import { quotes } from '../../quotes.esm.js'; const useStyles = makeStyles((theme) => ({ footer: { width: "100%", textAlign: "center", padding: theme.spacing(2) } })); const DevQuote = (options) => { const { extraQuotes } = options; const allQuotes = [...quotes, ...extraQuotes ?? []]; const classes = useStyles(); const randomQuote = allQuotes[Math.floor(Math.random() * allQuotes.length)]; return /* @__PURE__ */ jsxs("footer", { className: classes.footer, children: [ /* @__PURE__ */ jsx(Typography, { variant: "h6", children: randomQuote.text }), /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", children: randomQuote.author }) ] }); }; export { DevQuote }; //# sourceMappingURL=DevQuotes.esm.js.map