Files
medusa-store/www/packages/docs-ui/src/utils/format-report-link.ts
Shahed Nasser 987dd8f568 docs: expanded rating form + UI docs improvement (#5211)
* docs: expanded rating form + UI docs improvement

* added props table + changed example
2023-09-26 20:26:09 +03:00

18 lines
430 B
TypeScript

import { GITHUB_ISSUES_PREFIX, GITHUB_UI_ISSUES_PREFIX } from "../constants"
export type ReportLinkType = "default" | "ui"
export function formatReportLink(
title: string,
sectionTitle: string,
type?: ReportLinkType
) {
let prefix = GITHUB_ISSUES_PREFIX
if (type === "ui") {
prefix = GITHUB_UI_ISSUES_PREFIX
}
return `${prefix}&title=${encodeURI(title)}%3A%20Issue%20in%20${encodeURI(
sectionTitle
)}`
}