misc_pterodactyl-panel/resources/scripts/components/admin/AdminCheckbox.tsx

27 lines
698 B
TypeScript
Raw Normal View History

2021-01-01 00:27:16 +00:00
import Input from '@/components/elements/Input';
import React from 'react';
import styled from 'styled-components/macro';
import tw from 'twin.macro';
export const TableCheckbox = styled(Input)`
2021-01-01 00:27:16 +00:00
&& {
${tw`border-neutral-500 bg-transparent`};
&:not(:checked) {
${tw`hover:border-neutral-300`};
}
}
`;
export default ({ name, checked, onChange }: { name: string, checked: boolean, onChange(e: React.ChangeEvent<HTMLInputElement>): void }) => {
2021-01-01 00:27:16 +00:00
return (
<TableCheckbox
type={'checkbox'}
2021-01-01 00:27:16 +00:00
name={'selectedItems'}
value={name}
checked={checked}
onChange={onChange}
2021-01-01 00:27:16 +00:00
/>
);
};