mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
* deps: update next.js to 13 * chore: migrate to new Link component * chore: remove future option from next.config * chore: update react-select * chore: enable hideSourceMaps on sentry * chore: assert type as string * chore: make placeholder and value absolute * feat: set timeout for redirect * chore: ignore ts error * chore: add generics * chore: * chore: add ts comment * feat: use dnd-kit instead of react-sortable-hoc * fix: give absolute position to placeholder
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { Status } from '@utils/Constants'
|
|
|
|
import Tag from '@components/Tag'
|
|
|
|
import { SubmittedBot } from '@types'
|
|
import Link from 'next/link'
|
|
|
|
const SubmittedBotCard: React.FC<SubmittedBotProps> = ({ href, submit }) => {
|
|
return (
|
|
(<Link
|
|
href={href}
|
|
className='relative mx-auto px-4 py-5 w-full h-full text-black dark:text-white dark:bg-discord-black bg-little-white rounded-2xl shadow-xl transform hover:-translate-y-1 transition duration-100 ease-in'>
|
|
|
|
<div className='h-18'>
|
|
<div className='flex'>
|
|
<div className='grow w-full'>
|
|
<h2 className='text-lg'>{submit.id}</h2>
|
|
</div>
|
|
<div className='absolute right-0 grid grid-cols-1 px-4 w-2/5 h-0'>
|
|
<Tag
|
|
text={
|
|
<>
|
|
<i
|
|
className={`fas fa-circle text-${
|
|
[Status.offline, Status.online, Status.dnd][submit.state]?.color
|
|
}`}
|
|
/>{' '}
|
|
{['대기중', '승인됨', '거부됨'][submit.state]}
|
|
</>
|
|
}
|
|
dark
|
|
/>
|
|
</div>
|
|
</div>
|
|
<p className='mt-1.5 w-full h-6 text-left text-gray-400 text-sm font-medium truncate'>
|
|
{submit.intro.slice(0, 25)}
|
|
{submit.intro.length > 25 && '...'}
|
|
</p>
|
|
</div>
|
|
|
|
</Link>)
|
|
)
|
|
}
|
|
|
|
interface SubmittedBotProps {
|
|
href: string
|
|
submit: SubmittedBot
|
|
}
|
|
export default SubmittedBotCard
|