detach-synctex-control.tsx 714 B

1234567891011121314151617181920212223242526
  1. import { useLayoutContext } from '../../../shared/context/layout-context'
  2. import PdfSynctexControls from './pdf-synctex-controls'
  3. export function DefaultSynctexControl() {
  4. const { detachRole } = useLayoutContext()
  5. if (!detachRole) {
  6. return <PdfSynctexControls />
  7. }
  8. return null
  9. }
  10. export function DetacherSynctexControl() {
  11. const { detachRole, detachIsLinked } = useLayoutContext()
  12. if (detachRole === 'detacher' && detachIsLinked) {
  13. return <PdfSynctexControls />
  14. }
  15. return null
  16. }
  17. export function DetachedSynctexControl() {
  18. const { detachRole, detachIsLinked } = useLayoutContext()
  19. if (detachRole === 'detached' && detachIsLinked) {
  20. return <PdfSynctexControls />
  21. }
  22. return null
  23. }