mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-25 02:04:38 +00:00

Update vite-plugin-svgr to the latest version (4.2.0) ahead of updating vite to 5.x. This is a major version bump from our previous 3.x, and requires changing the import paths used for SVGs. Updates https://github.com/tailscale/corp/issues/17715 Signed-off-by: Mario Minardi <mario@tailscale.com>
32 lines
882 B
TypeScript
32 lines
882 B
TypeScript
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
import cx from "classnames"
|
|
import React, { forwardRef, InputHTMLAttributes } from "react"
|
|
import Search from "src/assets/icons/search.svg?react"
|
|
|
|
type Props = {
|
|
className?: string
|
|
inputClassName?: string
|
|
} & InputHTMLAttributes<HTMLInputElement>
|
|
|
|
/**
|
|
* SearchInput is a standard input with a search icon.
|
|
*/
|
|
const SearchInput = forwardRef<HTMLInputElement, Props>((props, ref) => {
|
|
const { className, inputClassName, ...rest } = props
|
|
return (
|
|
<div className={cx("relative", className)}>
|
|
<Search className="absolute text-gray-400 w-[1.25em] h-full ml-2" />
|
|
<input
|
|
type="text"
|
|
className={cx("input pl-9 pr-8", inputClassName)}
|
|
ref={ref}
|
|
{...rest}
|
|
/>
|
|
</div>
|
|
)
|
|
})
|
|
SearchInput.displayName = "SearchInput"
|
|
export default SearchInput
|