9
Switch language to العربية

Two Buttons

Previous

Dual button group component.

import React from "react"
import Link from "next/link"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"

interface Props {
  primaryLabel: string
  primaryHref: string
  secondaryLabel: string
  secondaryHref: string
  className?: string
}

export function TwoButtons({
  primaryLabel,
  primaryHref,
  secondaryLabel,
  secondaryHref,
  className,
}: Props) {
  return (
    <div className={cn("flex flex-wrap gap-4", className)}>
      <Button asChild>
        <Link href={primaryHref}>
          {primaryLabel}
        </Link>
      </Button>
      <Button variant="ghost" asChild>
        <Link href={secondaryHref}>
          {secondaryLabel}
        </Link>
      </Button>
    </div>
  )
}

Installation

pnpm dlx codebase add two-buttons

Usage

import { TwoButtons } from "@/components/atom/two-buttons"
<TwoButtons />