mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-17 21:37:06 -04:00
13 lines
373 B
TypeScript
13 lines
373 B
TypeScript
import { useRootLoaderData } from "~/client/hooks/use-root-loader-data";
|
|
import { formatBytes, type FormatBytesOptions } from "~/utils/format-bytes";
|
|
|
|
export const useFormatBytes = () => {
|
|
const { locale } = useRootLoaderData();
|
|
|
|
return (bytes: number, options?: FormatBytesOptions) =>
|
|
formatBytes(bytes, {
|
|
...options,
|
|
locale: options?.locale ?? locale,
|
|
});
|
|
};
|