"use client"

import { cn } from "@mdxui/primitives/lib/utils"
import { Button } from "@mdxui/primitives/button"
import { MdOutlineFeedback } from "react-icons/md"
import type { ComponentProps } from "react"

interface FeedbackTriggerProps extends ComponentProps<typeof Button> {
  label?: string
}

export function FeedbackTrigger({ label, className, ...props }: FeedbackTriggerProps) {
  return (
    <Button
      variant="outline"
      size={label ? "default" : "icon"}
      className={cn("gap-2", className)}
      {...props}
    >
      <MdOutlineFeedback className="size-4" />
      {label && <span>{label}</span>}
    </Button>
  )
}
