ui(admin): add "working" React admin ui
This commit is contained in:
parent
d1c7494933
commit
5402584508
199 changed files with 13387 additions and 151 deletions
36
resources/scripts/components/admin/AdminCheckbox.tsx
Normal file
36
resources/scripts/components/admin/AdminCheckbox.tsx
Normal file
|
@ -0,0 +1,36 @@
|
|||
import type { ChangeEvent } from 'react';
|
||||
import tw, { styled } from 'twin.macro';
|
||||
|
||||
import Input from '@/components/elements/Input';
|
||||
|
||||
export const TableCheckbox = styled(Input)`
|
||||
&& {
|
||||
${tw`border-neutral-500 bg-transparent`};
|
||||
|
||||
&:not(:checked) {
|
||||
${tw`hover:border-neutral-300`};
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export default ({
|
||||
name,
|
||||
checked,
|
||||
onChange,
|
||||
}: {
|
||||
name: string;
|
||||
checked: boolean;
|
||||
onChange(e: ChangeEvent<HTMLInputElement>): void;
|
||||
}) => {
|
||||
return (
|
||||
<div css={tw`flex items-center`}>
|
||||
<TableCheckbox
|
||||
type={'checkbox'}
|
||||
name={'selectedItems'}
|
||||
value={name}
|
||||
checked={checked}
|
||||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue