mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: recreate shared page
+ improve security by not exposing author's email
This commit is contained in:
24
inertia/components/dashboard/link/list/link_list.tsx
Normal file
24
inertia/components/dashboard/link/list/link_list.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Stack } from '@mantine/core';
|
||||
import { LinkItem } from '~/components/dashboard/link/item/link_item';
|
||||
import { NoLink } from '~/components/dashboard/link/no_link/no_link';
|
||||
import { useActiveCollection } from '~/stores/collection_store';
|
||||
|
||||
export interface LinkListProps {
|
||||
hideMenu?: boolean;
|
||||
}
|
||||
|
||||
export function LinkList({ hideMenu = false }: LinkListProps) {
|
||||
const { activeCollection } = useActiveCollection();
|
||||
|
||||
if (!activeCollection?.links || activeCollection.links.length === 0) {
|
||||
return <NoLink hideMenu={hideMenu} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack gap="xs">
|
||||
{activeCollection?.links.map((link) => (
|
||||
<LinkItem link={link} key={link.id} hideMenu={hideMenu} />
|
||||
))}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user