mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-02 03:48:14 +03:00
25 lines
461 B
TypeScript
25 lines
461 B
TypeScript
import React from "react";
|
|
import { Nav } from "react-bootstrap";
|
|
import { JustChildren, SetState } from "types/react";
|
|
|
|
export default function SelectNav<T>({
|
|
id,
|
|
value,
|
|
setValue,
|
|
children,
|
|
disabled = false,
|
|
}: {
|
|
id: T;
|
|
value: T;
|
|
setValue: SetState<T>;
|
|
disabled?: boolean;
|
|
} & JustChildren) {
|
|
return (
|
|
<Nav.Item>
|
|
<Nav.Link disabled={disabled} active={id === value} onClick={() => setValue(id)}>
|
|
{children}
|
|
</Nav.Link>
|
|
</Nav.Item>
|
|
);
|
|
}
|