refactor: Rename CodePreview component to ArtifactButton

This commit is contained in:
Danny Avila 2024-08-23 22:08:03 -04:00
parent 48ddf4039e
commit dc5b597a64
2 changed files with 4 additions and 4 deletions

View file

@ -5,7 +5,7 @@ import { useSetRecoilState, useRecoilValue } from 'recoil';
import type { Pluggable } from 'unified';
import type { Artifact } from '~/common';
import { artifactsState, artifactIdsState } from '~/store/artifacts';
import CodePreview from './CodePreview';
import ArtifactButton from './ArtifactButton';
import { logger } from '~/utils';
export const artifactPlugin: Pluggable = () => {
@ -118,5 +118,5 @@ export function Artifact({
updateArtifact();
}, [updateArtifact]);
return <CodePreview artifact={artifact} />;
return <ArtifactButton artifact={artifact} />;
}

View file

@ -5,7 +5,7 @@ import { useLocalize } from '~/hooks';
import { getFileType } from '~/utils';
import store from '~/store';
const CodePreview = ({ artifact }: { artifact: Artifact | null }) => {
const ArtifactButton = ({ artifact }: { artifact: Artifact | null }) => {
const localize = useLocalize();
const setArtifactId = useSetRecoilState(store.currentArtifactId);
if (artifact === null || artifact === undefined) {
@ -36,4 +36,4 @@ const CodePreview = ({ artifact }: { artifact: Artifact | null }) => {
);
};
export default CodePreview;
export default ArtifactButton;