import { IconBrandGithub } from "@tabler/icons-react"; import { buildErrorReportTemplate, buildGitHubIssueUrl, type ErrorReportTemplateOptions, } from "./error-reporting.js"; import { FeedbackButton } from "./FeedbackButton.js"; import { cn } from "./utils.js"; export interface ErrorReportActionsProps extends ErrorReportTemplateOptions { feedbackLabel?: string; feedbackPlaceholder?: string; githubLabel?: string; className?: string; feedbackClassName?: string; githubClassName?: string; side?: "top" | "bottom" | "left" | "right"; align?: "start" | "center" | "end"; } export function ErrorReportActions({ feedbackLabel = "Send feedback", feedbackPlaceholder = "Describe what happened before this error appeared.", githubLabel = "Open GitHub issue", className, feedbackClassName, githubClassName, side = "top", align = "center", ...report }: ErrorReportActionsProps) { const template = buildErrorReportTemplate({ ...report, prompt: report.prompt ?? feedbackPlaceholder, }); const githubIssueUrl = buildGitHubIssueUrl(report); return (
{githubLabel}
); }