mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-25 21:56:08 +00:00
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { ArrowRightIcon } from "lucide-react"
|
|
|
|
import { Button } from "@/styles/base-nova/ui/button"
|
|
import { ButtonGroup } from "@/styles/base-nova/ui/button-group"
|
|
import { Input } from "@/styles/base-nova/ui/input"
|
|
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectGroup,
|
|
SelectItem,
|
|
SelectTrigger,
|
|
} from "@/styles/base-nova/ui/select"
|
|
|
|
const CURRENCIES = [
|
|
{ label: "US Dollar", value: "$" },
|
|
{ label: "Euro", value: "€" },
|
|
{ label: "British Pound", value: "£" },
|
|
]
|
|
|
|
export default function ButtonGroupSelect() {
|
|
const [currency, setCurrency] = React.useState("$")
|
|
|
|
return (
|
|
<ButtonGroup>
|
|
<ButtonGroup>
|
|
<Select
|
|
items={CURRENCIES}
|
|
value={currency}
|
|
onValueChange={(value) => setCurrency(value as string)}
|
|
>
|
|
<SelectTrigger className="font-mono">{currency}</SelectTrigger>
|
|
<SelectContent alignItemWithTrigger={false} align="start">
|
|
<SelectGroup>
|
|
{CURRENCIES.map((item) => (
|
|
<SelectItem key={item.value} value={item.value}>
|
|
{item.value}{" "}
|
|
<span className="text-muted-foreground">{item.label}</span>
|
|
</SelectItem>
|
|
))}
|
|
</SelectGroup>
|
|
</SelectContent>
|
|
</Select>
|
|
<Input placeholder="10.00" pattern="[0-9]*" />
|
|
</ButtonGroup>
|
|
<ButtonGroup>
|
|
<Button aria-label="Send" size="icon" variant="outline">
|
|
<ArrowRightIcon />
|
|
</Button>
|
|
</ButtonGroup>
|
|
</ButtonGroup>
|
|
)
|
|
}
|