import { Button } from "../components/Button.tsx"; import { useEffect, useLayoutEffect, useRef } from "preact/hooks"; import { ComponentChildren } from "preact"; import { Signal, useSignal } from "@preact/signals"; import { IS_BROWSER } from "$fresh/runtime.ts"; import { mapValues } from "$std/collections/map_values.ts"; import { useAsync } from "../util/util.ts"; import { Coperation, CorpSimple, fetchKosdaqList, fetchKospiList, fetchPageInfo, PageCorpsInfo, } from "../util/api.ts"; interface StockProps { pageName: string; } interface ToggleButtonProps { disabled?: boolean; toggle: Signal; children?: ComponentChildren; } function ToggleButton(props: ToggleButtonProps) { const { disabled, toggle, ...rest } = props; return (