Layout, Pages, Dashboard, MUI

This commit is contained in:
cracklesparkle
2024-06-20 16:59:59 +09:00
parent d53694a0b3
commit d6906503d1
27 changed files with 8076 additions and 142 deletions

View File

@ -1,26 +1,26 @@
import { useState} from 'react'
import { useState } from 'react'
import RoleCard from '../components/RoleCard'
import Modal from '../components/Modal'
import useDataFetching from '../components/FetchingData'
interface IRoleCard{
id: number
name: string
}
interface IRoleCard {
id: number
name: string
}
interface Props {
showModal: boolean;
}
function Users() {
const [showModal, setShowModal] = useState<Props>({showModal: false});
const cards = useDataFetching<IRoleCard[]>("http://localhost:8000/auth/role/",[])
showModal: boolean;
}
function Roles() {
const [showModal, setShowModal] = useState<Props>({ showModal: false });
const cards = useDataFetching<IRoleCard[]>(`${import.meta.env.VITE_API_URL}/auth/role/`, [])
return (
<div>
{cards.map((card, index) => <RoleCard key={index} {...card}/>)}
<button className='absolute w-0 h-0' onClick={() => setShowModal({showModal:true})}>+</button>
<Modal {...showModal}/>
{cards.map((card, index) => <RoleCard key={index} {...card} />)}
<button className='absolute w-0 h-0' onClick={() => setShowModal({ showModal: true })}>+</button>
<Modal {...showModal} />
</div>
)
}
export default Users
export default Roles