Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

ArticleTitle.tsx 842 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  1. import { Tooltip, Link } from '@primer/components'
  2. import { PrinterIcon } from './PrinterIcon'
  3. type Props = {
  4. children: React.ReactNode
  5. }
  6. export const ArticleTitle = ({ children }: Props) => {
  7. return (
  8. <div className="d-flex flex-items-baseline flex-justify-between">
  9. <h1 className="my-4 border-bottom-0">{children}</h1>
  10. <div className="d-none d-lg-block ml-2">
  11. <Tooltip aria-label="Print this article" noDelay direction="n">
  12. <Link
  13. as="button"
  14. underline={false}
  15. muted
  16. onClick={() => {
  17. try {
  18. document.execCommand('print', false)
  19. } catch (e) {
  20. window.print()
  21. }
  22. }}
  23. >
  24. <PrinterIcon />
  25. </Link>
  26. </Tooltip>
  27. </div>
  28. </div>
  29. )
  30. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...