forked from abner/for-legacy-web
Use tabWidth 4 without actual tabs.
This commit is contained in:
@@ -3,20 +3,20 @@ import { useState } from "preact/hooks";
|
||||
const counts: { [key: string]: number } = {};
|
||||
|
||||
export default function PaintCounter({
|
||||
small,
|
||||
always,
|
||||
small,
|
||||
always,
|
||||
}: {
|
||||
small?: boolean;
|
||||
always?: boolean;
|
||||
small?: boolean;
|
||||
always?: boolean;
|
||||
}) {
|
||||
if (import.meta.env.PROD && !always) return null;
|
||||
if (import.meta.env.PROD && !always) return null;
|
||||
|
||||
const [uniqueId] = useState("" + Math.random());
|
||||
const count = counts[uniqueId] ?? 0;
|
||||
counts[uniqueId] = count + 1;
|
||||
return (
|
||||
<div style={{ textAlign: "center", fontSize: "0.8em" }}>
|
||||
{small ? <>P: {count + 1}</> : <>Painted {count + 1} time(s).</>}
|
||||
</div>
|
||||
);
|
||||
const [uniqueId] = useState("" + Math.random());
|
||||
const count = counts[uniqueId] ?? 0;
|
||||
counts[uniqueId] = count + 1;
|
||||
return (
|
||||
<div style={{ textAlign: "center", fontSize: "0.8em" }}>
|
||||
{small ? <>P: {count + 1}</> : <>Painted {count + 1} time(s).</>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user