+ {isAssistantV2Enabled && (
+ {
+ const sql = generateTriggerCreateSQL(x)
+ setAiAssistantPanel({
+ open: true,
+ initialInput: `Update this trigger which exists on the ${x.schema}.${x.table} table to...`,
+ suggestions: {
+ title:
+ 'I can help you make a change to this trigger, here are a few example prompts to get you started:',
+ prompts: [
+ 'Rename this trigger to ...',
+ 'Change the events this trigger responds to ...',
+ 'Modify this trigger to run after instead of before ...',
+ ],
+ },
+ sqlSnippets: [sql],
+ })
+ }}
+ >
+
+
-
- You need additional permissions to create triggers
-
-
-
-
+ className="px-1 pointer-events-auto"
+ icon={
+
+ }
+ onClick={() =>
+ setAiAssistantPanel({
+ open: true,
+ initialInput: `Create a new trigger for the schema ${selectedSchema} that does ...`,
+ suggestions: {
+ title:
+ 'I can help you create a new trigger, here are a few example prompts to get you started:',
+ prompts: [
+ 'Create a trigger that logs changes to the users table',
+ 'Create a trigger that updates updated_at timestamp',
+ 'Create a trigger that validates email format before insert',
+ ],
+ },
+ })
+ }
+ tooltip={{
+ content: {
+ side: 'bottom',
+ text: !canCreateTriggers
+ ? 'You need additional permissions to create triggers'
+ : 'Create with Supabase Assistant',
+ },
+ }}
+ />
)}
-
+