[skip ci] Initial commit — CodexBar Mobile Expo app

This commit is contained in:
2026-06-24 16:28:28 +02:00
parent 4f32782eaf
commit 0bcd95ee1b
30 changed files with 3562 additions and 141 deletions
+30
View File
@@ -0,0 +1,30 @@
import { useEffect, useState } from "react";
import { Text } from "react-native";
import { formatResetCountdown, formatResetCountdownISO } from "@/lib/timeUtils";
interface ResetCountdownProps {
resetAtSeconds?: number;
resetAtISO?: string;
}
export function ResetCountdown({ resetAtSeconds, resetAtISO }: ResetCountdownProps) {
const getLabel = () => {
if (resetAtSeconds !== undefined) return formatResetCountdown(resetAtSeconds);
if (resetAtISO) return formatResetCountdownISO(resetAtISO);
return "";
};
const [label, setLabel] = useState(getLabel);
useEffect(() => {
setLabel(getLabel());
const interval = setInterval(() => setLabel(getLabel()), 60_000);
return () => clearInterval(interval);
}, [resetAtSeconds, resetAtISO]);
if (!label) return null;
return (
<Text className="text-xs text-neutral-500 dark:text-neutral-400">{label}</Text>
);
}