equationSymbol.tsx 553 B

1234567891011121314151617181920212223
  1. import {forwardRef} from 'react';
  2. import {Symbol} from './querySymbol';
  3. interface EquationSymbolProps extends React.ComponentProps<typeof Symbol> {
  4. equationId: number;
  5. }
  6. export function getEquationSymbol(equationId: number) {
  7. return `ƒ${equationId + 1}`;
  8. }
  9. export const EquationSymbol = forwardRef<HTMLSpanElement, EquationSymbolProps>(
  10. function EquationSymbol({equationId, ...props}, ref) {
  11. return (
  12. <Symbol ref={ref} {...props}>
  13. <span>
  14. ƒ<sub>{equationId + 1}</sub>
  15. </span>
  16. </Symbol>
  17. );
  18. }
  19. );