mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-02 11:58:12 +03:00
27 lines
624 B
TypeScript
27 lines
624 B
TypeScript
import React from "react";
|
|
import { Form } from "react-bootstrap";
|
|
import { JustChildren } from "types/react";
|
|
|
|
export default function CheckEdit<T extends string>({
|
|
currentType,
|
|
type,
|
|
onChange,
|
|
children,
|
|
}: { type: T; currentType: T; onChange: () => void } & JustChildren) {
|
|
return (
|
|
<div
|
|
className={`my-4 ${currentType !== type ? "text-body-secondary" : ""}`}
|
|
style={{ fontWeight: currentType === type ? "bold" : "" }}
|
|
>
|
|
<Form.Check
|
|
type="radio"
|
|
style={{ display: "inline" }}
|
|
className="me-4"
|
|
checked={currentType === type}
|
|
onChange={onChange}
|
|
/>{" "}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|