import { useState } from 'react';
import { useInterval } from 'usehooks-ts';

import { getCanPaste } from './actions/copyPaste';

export default function useCanPaste() {
  const [canPaste, setCanPaste] = useState(getCanPaste());
  useInterval(() => {
    setCanPaste(getCanPaste()); // hax. getCanPaste needs to be made reactive at some point.
  }, 100);
  return canPaste;
}
