export const SITE_NAME = "용산 공중케이블 주민 안전 협의회"; export const SITE_SHORT_NAME = "용공협"; export const SITE_DESCRIPTION = "용산구 공중케이블 문제 해결과 안전한 거리 환경 조성을 위해 활동하는 주민 모임입니다."; export const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? "https://saftyovhcable.kr"; export const BLOG_URL = "https://blog.naver.com/safetyovhcable"; export const LEGACY_MAP_URL = process.env.NEXT_PUBLIC_LEGACY_MAP_URL ?? "https://saftyovhcable.kr/addMarker.html"; export const POST_TYPES = { NOTICE: "공지사항", ARCHIVE: "자료실", } as const; export type PostType = keyof typeof POST_TYPES; export const NOTICE_CATEGORIES = ["공지", "행사", "보도", "성명"] as const; export const ARCHIVE_CATEGORIES = ["보고서", "회의자료", "서식", "홍보물", "사진"] as const; export const POST_STATUSES = { PUBLISHED: "공개", DRAFT: "임시저장", } as const; export const INQUIRY_STATUSES = { NEW: "접수", IN_PROGRESS: "처리중", DONE: "완료", } as const; export const PAGE_SIZE = 10; export const ADMIN_PAGE_SIZE = 15; export const SURVEY_COUNT_LABEL = "1,700+"; export const ACTIVITY_START_YEAR = "2024"; export function formatDate(value: Date | string) { const date = typeof value === "string" ? new Date(value) : value; return new Intl.DateTimeFormat("ko-KR", { year: "numeric", month: "2-digit", day: "2-digit", timeZone: "Asia/Seoul", }) .format(date) .replace(/\.$/, ""); } export function formatDateTime(value: Date | string) { const date = typeof value === "string" ? new Date(value) : value; return new Intl.DateTimeFormat("ko-KR", { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", timeZone: "Asia/Seoul", }).format(date); } export function formatBytes(bytes: number) { if (!Number.isFinite(bytes) || bytes <= 0) return "0 B"; const units = ["B", "KB", "MB", "GB"]; const index = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1); return `${(bytes / 1024 ** index).toFixed(index === 0 ? 0 : 1)} ${units[index]}`; }