mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(core): new empty states for doc/collection/tag (#8197)
AF-1329, AF-1330
This commit is contained in:
@@ -16,6 +16,9 @@ export type EmptyContentProps = {
|
||||
descriptionStyle?: CSSProperties;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated use different empty components for different use cases, like `EmptyDocs` for documentation empty state
|
||||
*/
|
||||
export const Empty = ({
|
||||
containerStyle,
|
||||
title,
|
||||
|
||||
17
packages/frontend/component/src/ui/themed-img/index.tsx
Normal file
17
packages/frontend/component/src/ui/themed-img/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useTheme } from 'next-themes';
|
||||
import { forwardRef, type HTMLAttributes } from 'react';
|
||||
|
||||
export interface ThemedImgProps
|
||||
extends Omit<HTMLAttributes<HTMLImageElement>, 'src'> {
|
||||
lightSrc: string;
|
||||
darkSrc?: string;
|
||||
}
|
||||
|
||||
export const ThemedImg = forwardRef<HTMLImageElement, ThemedImgProps>(
|
||||
function ThemedImg({ lightSrc, darkSrc, ...attrs }, ref) {
|
||||
const { resolvedTheme } = useTheme();
|
||||
const src = resolvedTheme === 'dark' && darkSrc ? darkSrc : lightSrc;
|
||||
|
||||
return <img ref={ref} src={src} {...attrs} />;
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user