This commit is contained in:
Mckay Wrigley
2023-03-27 09:38:56 -06:00
committed by GitHub
parent 2269403806
commit 34c79c0d66
51 changed files with 1744 additions and 295 deletions
+31
View File
@@ -0,0 +1,31 @@
import { Prompt } from '@/types/prompt';
import { FC } from 'react';
import { PromptComponent } from './Prompt';
interface Props {
prompts: Prompt[];
onUpdatePrompt: (prompt: Prompt) => void;
onDeletePrompt: (prompt: Prompt) => void;
}
export const Prompts: FC<Props> = ({
prompts,
onUpdatePrompt,
onDeletePrompt,
}) => {
return (
<div className="flex w-full flex-col gap-1">
{prompts
.slice()
.reverse()
.map((prompt, index) => (
<PromptComponent
key={index}
prompt={prompt}
onUpdatePrompt={onUpdatePrompt}
onDeletePrompt={onDeletePrompt}
/>
))}
</div>
);
};