⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
explore
/
Edit File: ElapsedTime.tsx
import React, { useState, useEffect } from 'react'; import { useInterval } from 'react-use'; import { Time, TimeProps } from './Time'; const INTERVAL = 150; export interface ElapsedTimeProps extends Omit<TimeProps, 'timeInMs'> { // Use this to reset the timer. Any value is allowed just need to be !== from the previous. // Keep in mind things like [] !== [] or {} !== {}. resetKey?: unknown; } export const ElapsedTime = ({ resetKey, humanize, className }: ElapsedTimeProps) => { const [elapsed, setElapsed] = useState(0); // the current value of elapsed // hook that will schedule a interval and then update the elapsed value on every tick. useInterval(() => setElapsed(elapsed + INTERVAL), INTERVAL); // this effect will only be run when resetKey changes. This will reset the elapsed to 0. useEffect(() => setElapsed(0), [resetKey]); return <Time timeInMs={elapsed} className={className} humanize={humanize} />; };
Simpan