mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
b1dffc3486
* Convert insights from sidebar to modal dialog - Remove insights routing and sidebar layout - Update DocumentMeta to use modal action instead of navigation - Convert Insights component to modal-ready format - Clean up route helpers and authenticated layout - Remove insights route from authenticated routes Co-authored-by: Tom Moor <tom@getoutline.com> * Applied automatic fixes * refactor * singular * refactor --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
import { formatNumber } from "~/utils/language";
|
|
import useUserLocale from "./useUserLocale";
|
|
import { unicodeCLDRtoBCP47 } from "@shared/utils/date";
|
|
|
|
/**
|
|
* Hook that returns a function to format numbers based on the user's locale.
|
|
*
|
|
* @returns A function that formats numbers
|
|
*/
|
|
export function useFormatNumber() {
|
|
const language = useUserLocale();
|
|
return (input: number) =>
|
|
language
|
|
? formatNumber(input, unicodeCLDRtoBCP47(language))
|
|
: input.toString();
|
|
}
|