Files
supabase/apps/studio/components/interfaces/DiskManagement/ui/FormMessage.tsx
T
Gildas Garcia b30db91d71 chore: cleanup UI patterns exports (#47406)
## Problem

We now export components under a subpath in ui-patterns to avoid barrel
files as they slow down every tools (from IDE to linters, etc.) and may
also affect bundles our users have to download.

## Solution

- Remove the UI patterns index file
- Fix invalid impors
2026-06-30 09:23:17 +02:00

33 lines
810 B
TypeScript

import { AnimatePresence, motion } from 'framer-motion'
import { Admonition } from 'ui-patterns/admonition'
interface FormMessageProps {
message: string
type?: 'error' | 'success'
children?: React.ReactNode
}
function FormMessage({ message = 'error', type, children }: FormMessageProps) {
return (
<AnimatePresence>
{message && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
exit={{ opacity: 0, height: 0 }}
>
<Admonition
type={type === 'error' ? 'destructive' : 'default'}
className="mt-2"
title={message}
>
{children}
</Admonition>
</motion.div>
)}
</AnimatePresence>
)
}
export default FormMessage