slopus--happy
98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
29 行
717 B
TypeScript
29 行
717 B
TypeScript
import './SelectButton.css'
|
|
|
|
interface SelectButtonProps {
|
|
label: string
|
|
width?: number
|
|
}
|
|
|
|
function ChevronDownIcon() {
|
|
return (
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<path d="m6 9 6 6 6-6" />
|
|
</svg>
|
|
)
|
|
}
|
|
|
|
export function SelectButton({ label, width = 240 }: SelectButtonProps) {
|
|
return (
|
|
<button
|
|
type="button"
|
|
className="select-button"
|
|
style={{ width }}
|
|
aria-label={label}
|
|
>
|
|
<span className="select-button__label">{label}</span>
|
|
<ChevronDownIcon />
|
|
</button>
|
|
)
|
|
}
|