mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 07:03:25 +00:00
refactor: rename link_list with a proper name
This commit is contained in:
31
inertia/components/dashboard/link/link_list.tsx
Normal file
31
inertia/components/dashboard/link/link_list.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import type Link from '#models/link';
|
||||
import styled from '@emotion/styled';
|
||||
import LinkItem from '~/components/dashboard/link/link_item';
|
||||
import { NoLink } from '~/components/dashboard/link/no_item';
|
||||
|
||||
const LinkListStyle = styled.ul({
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
minWidth: 0,
|
||||
display: 'flex',
|
||||
flex: 1,
|
||||
gap: '0.5em',
|
||||
padding: '3px',
|
||||
flexDirection: 'column',
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'scroll',
|
||||
});
|
||||
|
||||
export default function LinkList({ links }: { links: Link[] }) {
|
||||
if (links.length === 0) {
|
||||
return <NoLink />;
|
||||
}
|
||||
|
||||
return (
|
||||
<LinkListStyle>
|
||||
{links.map((link) => (
|
||||
<LinkItem link={link} key={link.id} showUserControls />
|
||||
))}
|
||||
</LinkListStyle>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user