mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
30 lines
628 B
TypeScript
30 lines
628 B
TypeScript
import CardButton from 'components/ui/CardButton'
|
|
import { useState } from 'react'
|
|
|
|
export interface SQLCardProps {
|
|
title: string
|
|
description: string
|
|
sql: string
|
|
onClick: (sql: string, title: string) => void
|
|
}
|
|
|
|
const SQLCard = ({ title, description, sql, onClick }: SQLCardProps) => {
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
function handleOnClick() {
|
|
setLoading(true)
|
|
onClick(sql, title)
|
|
}
|
|
return (
|
|
<CardButton
|
|
title={title}
|
|
loading={loading}
|
|
onClick={() => handleOnClick()}
|
|
description={description}
|
|
className="xl:h-48 p-6"
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default SQLCard
|