refactor: simplify DigitalClock and TimeConverter components

This commit is contained in:
Loic Coenen
2026-06-25 10:43:36 +02:00
committed by Loic Coenen (aider)
parent 3fed6dc168
commit 0b8d76a057
5 changed files with 43 additions and 41 deletions

View File

@@ -25,7 +25,6 @@ export function DigitalClock({
return (
<div>
<span data-testid="digital-clock">{dateToDigital(currentTime)}</span>
<input
data-testid="time-input"
type="text"

View File

@@ -6,7 +6,7 @@ import { dateToBerlin } from "../utils";
export function TimeConverter() {
const { currentTime, setCurrentTime } = useCurrentTime();
const [useSystemTime, setUseSystemTime] = useState(false);
const [useSystemTime, setUseSystemTime] = useState(true);
const berlinClock = dateToBerlin(currentTime);
useEffect(() => {
@@ -18,7 +18,7 @@ export function TimeConverter() {
}, [useSystemTime, setCurrentTime]);
return (
<div>
<div className="time-converter">
<BerlinClock enabled={true} clock={berlinClock} />
<DigitalClock
currentTime={currentTime}