Keep code style consistent by (1) avoiding redundant imports and (2) centralizing shared UI values.
React namespace just for JSX.
import { useEffect, useRef, useState } from "react";
constants/ module) and import them everywhere.
// constants/starCounts.ts
export const STARS_LOADING_DISPLAY = "28k";
// component
import { STARS_LOADING_DISPLAY } from "@/constants/starCounts";
const label = `${isLoading ? STARS_LOADING_DISPLAY : stars}+`;